do you actually have an attribute on your input element called "defaultValue"?

like this:

<input type="text" name="myText" id="myTextID" value="someValue" defaultValue="theDefaultValue">

then you could say:

$("#myTextID").val();

and that would give you: someValue

or you could say:

$("#myTextID").attr("defaultValue");

and that would give you: theDefaultValue.

you could also set both values:

$("#myTextID").val("someOtherValue");

and

$("#myTextID").attr("defaultValue", "theNewDefaultValue");

Does that help?

Cheers,
Chris

[EMAIL PROTECTED] wrote:
While i can acces a default value of an input field by:
field.defaultValue

i can't access it by $(field).attr('defaultValue')
All other attributes i can acces via the .attr() method but not this
one.
Can it be added?



--
http://cjordan.info

Reply via email to