Say I have this div:
<div id='myDiv'>
<input type='text' id='foo' size='30' />
</div>
and i run this javascript code:
($("#foo").val('bar');
If I then do:
alert($("#myDiv").html());
or
alert(document.getElementById('myDiv').innerHTML);
I get only the original copy of the html where the value of foo
textbox is still blank. I would like to get a current copy of the html with a value='bar'
attribute added to foo's html code.
How can this be done?