title: Passing a value to modal
body: <p>I have a <code>&lt;table&gt;</code> and under one its <code>&lt;td&gt;</code>, I am printing a different value and there is also a button on each <code>&lt;td&gt;</code>. Upon clicking the button, I want to pass the value to the modal. Here's what I got so far:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;a data-toggle="modal" data-id="123" href="room.html#myModal"&gt;
      Check in
  &lt;/a&gt;
  &lt;div class="modal hide" id="myModal"&gt;
      &lt;div class="modal-header"&gt;
          &lt;button class="close" data-dismiss="modal"&gt;×&lt;/button&gt;
          &lt;h3&gt;Modal header&lt;/h3&gt;
      &lt;/div&gt;
      &lt;div class="modal-body"&gt;
          Room Number: &lt;a name="roomnumber" id="roomnumber"&gt;&lt;/a&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>$(document).on("click", ".modal", function () {
      var roomNumber = $(this).data('id');
      $(".modal-body #roomnumber").val(roomNumber);
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/jelloshio/hv32v3kq/" rel="nofollow">Fiddle</a>.</p>