Possible to get hard coded attribute value, not DOM value
Moderator: General Moderators
Possible to get hard coded attribute value, not DOM value
If I have an input tag with a value="foo" attribute, and later the user changes that element's value, how would I get back it's original value without calling reset() on the entire form? Is this possible with DOM scripting in any way?
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Possible to get hard coded attribute value, not DOM value
Code: Select all
document.getElementById("field").defaultValueRe: Possible to get hard coded attribute value, not DOM value
Thanks! (sounds familiar too) Is there some sort of DOM API documentation that you can recommend (for when I forget again)
Re: Possible to get hard coded attribute value, not DOM value
http://www.w3.org/TR/DOM-Level-2-HTML/html.html 
https://developer.mozilla.org/en/gecko_dom_reference
https://developer.mozilla.org/en/gecko_dom_reference
There are 10 types of people in this world, those who understand binary and those who don't
Re: Possible to get hard coded attribute value, not DOM value
Nice. I'd tattoo it to my inner eyelids but I dont think itd fit.