Accessing variables from javascript in modal (noob)
<p>How can I get modelname to show up in the modal. In other words, how do I properly pass the variable from javascript to my modal?</p>

<p>I have the following javascript:</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).on("click", ".cadlib", function () {
     var modelname = $('#modelname').text();
     $('#myModal').modal('show');
});
</code></pre>

<p>And a modal dialog:</p>

<pre><code>&lt;div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
&lt;div class="modal-header"&gt;
&lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;×&lt;/button&gt;
&lt;h3 id="myModalLabel"&gt;My Modal&lt;/h3&gt;
&lt;/div&gt;
&lt;div class="modal-body"&gt;
Here's all the info you would want to know about {{modelname}} 
&lt;/div&gt;
&lt;/div&gt;
</code></pre>
