jquery - get html content after changing selectbox value -


i using following function catch div content.

function gethtml(div) {     div.find("input").each(function () {         $(this).attr("value", $(this).val());     });     return div.html(); } 

and catching data following

var updatesearchcontent = gethtml($('#someform')); 

but if there select box in div , change value, function catch initial state default value.

how can solve this? if change select box value should save the change value default.

if have select in div need bind change event values when change:

$('#someform').on('change','selecttags', function() {     alert( $(this).find(":selected").val() ); }); 

note select allow multiple values selected , return might array of values.

check boxes , radio buttons need considered if included in form have different set of values.

just note question:

$('select').prop("type"); 

will return either "select-one" or "select-multiple" depending upon "multiple" attribute

see question full discussion on input type detection: how input type using jquery?


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -