I am searching for a means, with jQuery, to obtain the default worth of a port area (within an HTML area).
Appears not so difficult. Just calling
$("#id-of-field").attr('value') should return the worthiness I am wanting right?
Factor is, when the value is
Foo, after i load the page, it returns
Foo. Not a problem there. But when I write
Bar within the area, then reload (not submit) the page,
$("#id-of-field").attr('value') will return me
Bar, even when within the source code, the worthiness attribute from the area continues to be
Which makes validation of my form sticky, because after i get my default values to disregard them when the area is not filled, I possibly could obtain a real value within the mixture of "Values to become overlooked".
FYI, I can not make the values by hand, because the form is dynamic, and can't query directly the database since it is a Wordpress Website.
You could attempt -
Which should obtain the DOM
defaultValue property that ought to provide you with the original worth of the textbox
Input fields possess the
defaultValue DOM property that does exactly the thing you need.
Based on this answer, the jQuery (> 1.6.3) means to access it's