Hi,
I have following working code, I can see the newly added form field's
value is set to 'new york', now when I change the line that does the
InsertAfter("#test") to:
jQuery("#test").after().load("Test.html")
Test.html contains: <input type='text' name='city' id='city'
size='30' />, same as the line I replaced, i can see also the newly
added form field, but the value can not be assigned, it's blank
instead of 'new york', what's the difference ?
<script type="text/javascript">
$(document).ready(function(){
$("<input type='text' name='city' id='city' size='30' /
>").insertAfter("#test");
$("input#city").val("new york");
});
</script>
<form>
<input type="text" name="country" id="country" />
<div id="test">
</div>
<input type="submit" name="Submit" value="Submit" />
</form>