title: bootstrap modal button click event not fired on first time
body: <p>i am new to twitter bootstrap .i am using the bootstrap 3
  and  this is my html code</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Bootstrap Samples&lt;/title&gt;
  &lt;script src="scripts/jquery1.10.2.min.js"&gt;&lt;/script&gt;
  &lt;script src="bootstrap-3.1.1-dist/js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" type="text/css" href="bootstrap-3.1.1-dist/css/bootstrap.min.css" /&gt;
  &lt;link rel="stylesheet" type="text/css" href="bootstrap-3.1.1-dist/css/bootstrap-theme.min.css" /&gt;
  &lt;style&gt;
  .banner {color:#FF0000;}
  &lt;/style&gt;
  &lt;script&gt;
  $(document).ready(function(){
  $("#MyModal5").on('hidden.bs.modal',function(){
              $("#btnYes").on('click',function(e){
                  var $myMod = $(this);
                  var id = $myMod.data('cust-id');
                  if(id=='y'){
                      alert("You clicked yes button");
                  }
              });
          });
      });
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;!-- -------------------------------------------------------------------- --&gt;
  &lt;div class="modal fade" id="MyModal5"&gt;
      &lt;div class="modal-dialog modal-sm"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-title"&gt;
                  &lt;label style="color:#FF6600;"&gt;Confirmation&lt;/label&gt;
              &lt;/div&gt;
              &lt;div class="modal-header"&gt;
                  &lt;button class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
                  &lt;label&gt;This may cause to make an additional hit to server. Are you sure you want to continue ?&lt;/label&gt;
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
                  &lt;button class="btn btn-success btn-sm" id="btnYes" data-cust-id="y" data-dismiss="modal"&gt;Yes&lt;/button&gt;
                  &lt;button class="btn btn-danger btn-sm" id="btnNo" data-cust-id="n" data-dismiss="modal"&gt;No&lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;!-- -------------------------------------------------------------------- --&gt;
  &lt;div class="container"&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-sm-12"&gt;
              &lt;label&gt;If you want to visit google&lt;/label&gt;&lt;a href="#" data-toggle="modal" data-target="#MyModal5"&gt;Click here&lt;/a&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>idea is that i have a link, while i click on that link i need to populate the model.its working,now if i click on the 'yes' button on that modal ,i need an alert, but problem is that alert is not showing when i click  on yes button for first time  ,but if  i again click on that button for second time it is showing,another problem is tht if i clicked on third time alert is showing twise,i   dont know the exact reason,i suspect this is because of the on event of jquery.
  can any one help me to slove this issue</p>