value property (attribute)
Sets or returns the value of the current attribute.
The value property is similar to the nodeValue property, but it always returns the value of an attribute as a string in Internet Explorer as well. Note: the nodeValue and value properties of an attribute object always return null for certain event attributes (e.g. onload) in Internet Explorer, regardless of whether they are specified.
To get the name of an attribute, use the name property.
You can find the related objects in the Supported by objects section below.
This property is read/write.
String that sets or retrieves the value.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the value property:
Did you find this example helpful?
User Contributed Comments