I have div with generated input fields. After button click I want to refresh div and then set values.
<div>
<input id="1" name="1" type="text" />
<input id="2" name="2" type="text" />
</div>
<button type="button" onClick="change();">Change</button>
Javascript function:
function change(){
$('div').load(' div');
$("input[type='text']").val("some text");
}
Why after load I can't set values for input? How can I solve it? Thanks
change()on load of the DOM...? Also, what are you expectingload(' div')to do, as it's not a valid usage of theload()method.