title: Jquery, Bootstrap - trigger click event on modal hide and select text in input
body: <p>How can I select text inside input when the modal is closed? Below code is working - when I click the input field, alert is coming up and text is selected.  On <strong>modal hide event</strong> alert is shown, but the text is not selected. What is going on here?</p>
  
  <p>JS Code:</p>
  
  <pre><code>// Sellect text
  $('.user').on('click', '#name', function(){
          $(this).select();
          alert(1);
      });
  $('#myModal').on('hide.bs.modal', function(){
  
      $('.user').find('#name').trigger('click');
  
  });
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;div class="user"&gt;
    &lt;p&gt;Name
          &lt;input type="text" name="name" id="name" value="&lt;?php echo $user-&gt;name ?&gt;" readonly="readonly"&gt;
    &lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>SOLUTION</strong></p>
  
  <p>I found out that instead of using <strong>hide.bs.modal</strong> event, I should use <strong>hidden.bs.modal</strong> event. In that case the script is working.</p>