Maybe I'm not understanding something basic here, but the html() call doesn't return an element with all attributes filled in, even after an explicit call to set the attribute.
For example, I have a text box:
<input type="text" id="foo" value="" />
When the user fills in a value in this box, a function is called (onBlur of input text box).
$('#foo').blur(function(event) { updateFoo(this); });
In that function the following code exists:
function updateFoo(input) {
// force DOM update??
$('#'+input.id).attr('value', input.value);
// successfully displays value user entered
alert($('#'+input.id).attr('value'));
// displays input element, with value not filled in,
// like: 'input type="text" id="foo" value="" />'
alert($('#'+input.id).parent().html());
...
}
Shouldn't the html() call return the element with the value attribute set?
I'm using Firefox 3.6.13 on Max OSX.
I saw this forum post: http://forums.asp.net/t/1578929.aspx which I based some of my assumptions off of...
Thanks, Galen