title: Open Modal by clicking the link
body: <p>I have code below to show data from mysql in modal popup. Everything works very well, but I want to open modal by clicking the link instead the button.</p>
  
  <p>Is this even possible, because I have POST method in javascript? </p>
  
  <p>Any advice?</p>
  
  <p>Thank you!</p>
  
  <p>My code:</p>
  
  <pre><code>&lt;input type="button" name="view" value="view" id="&lt;?php echo $row["id"]; ?&gt;" class="view_data" /&gt;
  
  
   &lt;div id="dataModal" class="modal fade"&gt;  
        &lt;div class="modal-dialog"&gt;  
             &lt;div class="modal-content"&gt;  
                  &lt;div class="modal-header"&gt;  
                       &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;  
                       &lt;h4 class="modal-title"&gt;Employee Details&lt;/h4&gt;  
                  &lt;/div&gt;  
                  &lt;div class="modal-body" id="employee_detail"&gt;  
                  &lt;/div&gt;  
                  &lt;div class="modal-footer"&gt;  
                       &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;  
                  &lt;/div&gt;  
             &lt;/div&gt;  
        &lt;/div&gt;  
   &lt;/div&gt;  
  
   &lt;script&gt;  
  
        $(document).on('click', '.view_data', function(){  
             var employee_id = $(this).attr("id");  
             if(employee_id != '')  
             {  
                  $.ajax({  
                       url:"select.php",  
                       method:"POST",  
                       data:{employee_id:employee_id},  
                       success:function(data){  
                            $('#employee_detail').html(data);  
                            $('#dataModal').modal('show');  
                       }  
                  });  
             }            
        });  
  
   &lt;/script&gt;
  </code></pre>