title: Bootstrap modal close button
body: <p>I have a problem with the close modal in bootstrap. When I open a modal windows with data (Varying modal content based on trigger button). This is the example in <a href="http://getbootstrap.com/javascript/#modals" rel="nofollow noreferrer">http://getbootstrap.com/javascript/#modals</a> </p>
  
  <pre><code>&lt;button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo"&gt;Open modal for @mdo&lt;/button&gt;
  &lt;button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@fat"&gt;Open modal for @fat&lt;/button&gt;
  &lt;button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@getbootstrap"&gt;Open modal for @getbootstrap&lt;/button&gt;
  ...more buttons...
  
  &lt;div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"&gt;
    &lt;div class="modal-dialog" role="document"&gt;
      &lt;div class="modal-content"&gt;
        &lt;div class="modal-header"&gt;
          &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;
          &lt;h4 class="modal-title" id="exampleModalLabel"&gt;New message&lt;/h4&gt;
        &lt;/div&gt;
        &lt;div class="modal-body"&gt;
          &lt;form&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="recipient-name" class="control-label"&gt;Recipient:&lt;/label&gt;
              &lt;input type="text" class="form-control" id="recipient-name"&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="message-text" class="control-label"&gt;Message:&lt;/label&gt;
              &lt;textarea class="form-control" id="message-text"&gt;&lt;/textarea&gt;
            &lt;/div&gt;
          &lt;/form&gt;
        &lt;/div&gt;
        &lt;div class="modal-footer"&gt;
          &lt;button type="button" class="btn btn-default" id="btnclose" data-dismiss="modal"&gt;Close&lt;/button&gt;
          &lt;button type="button" id="btnsend" class="btn btn-primary"&gt;Send message&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is okay but if I close the modal and open using another button, when I click on the send button, it prints in console the recipient value of the first modal and this modal. But I need only print the last recipient value. 
  I don't understand why it stacked the events of the previous modal close. 
  This is my jQuery code, for both buttons:</p>
  
  <pre><code>    $('#exampleModal').on('show.bs.modal', function (event) {
  
      var button = $(event.relatedTarget) // Button that triggered the modal
      var recipient = button.data('whatever') // Extract info from data-* attributes
      // If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
      // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
      var modal = $(this)
      modal.find('.modal-title').text('New message to ' + recipient)
      modal.find('.modal-body input').val(recipient)
  
      $("#btnsend").one("click", function(){
          console.log('Pinchado')
        console.log(recipient)
      })
  
      $("#btnclose").one("click", function(){
          console.log('Cerrando...')
      })
  
      $('#exampleModal').on('hidden.bs.modal', function (e) {
        console.log('Cerrada');
      })
  
    })
  </code></pre>
  
  <p>Thanks you very much and I hope anyone can help me.
  <a href="https://jsfiddle.net/DTcHh/28480/" rel="nofollow noreferrer">https://jsfiddle.net/DTcHh/28480/</a></p>