title: Understanding how data-dismiss attribute works in Bootstrap
body: <p>I'm new to Bootstrap and i'm facing problem with this example:</p>
  
  <pre><code>&lt;!-- Trigger the modal with a button --&gt;
  &lt;button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal"&gt;Open Modal&lt;/button&gt;
  
  &lt;!-- Modal --&gt;
  &lt;div id="myModal" class="modal fade" role="dialog"&gt;
    &lt;div class="modal-dialog"&gt;
  
      &lt;!-- Modal content--&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;Modal Header&lt;/h4&gt;
        &lt;/div&gt;
        &lt;div class="modal-body"&gt;
          &lt;p&gt;Some text in the modal.&lt;/p&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;
  </code></pre>
  
  <p>As per my understanding <code>data-dismiss="modal"</code> attribute should close the modal if you click on it, but i don't understand how it works behind the scene. I checked the official documentation at: <a href="http://getbootstrap.com/javascript/#modals-examples" rel="noreferrer">http://getbootstrap.com/javascript/#modals-examples</a> but there's no explaination.</p>