jquery - How can I change the heading of the modal depending on the selected option -
working off question: passing data bootstrap 3 modal
in these examples, data-id sent text box, line:
<input type="text" name="bookid" id="bookid" value="" />
how send data (may variable) can make heading of modal instead of using input type. tried this, not work:
<p type="text" name="bookid" id="bookid" value="" />
for example, in fiddle: http://jsfiddle.net/4xj54/
the data-id "isbn" populated in text box. how data-id "isbn" show heading instead?
use text()
function. .val()
inputs , <p>
not support value.
$("#bookid").text(mybookid); // <p> $("h4.modal-title").text(mybookid);// modal title
Comments
Post a Comment