[jQuery] $.val() limited in functionality?
> The API says that $.val() will:
> Get the current value of the first matched element.
Yes, it is equivalent to $().attr("value") so it gets the value attribute of
the first element.
> The API says that $.val( string ) will:
> Set the value of every matched element.
Yes, it will set a "value" attribute for each element, regardless of whether
the doctype indicates the element has a "value" attribute. Generally you'd
only want to use .val() in cases where the element responded to having a
"value" attribute though.