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 

updated fiddle


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -