This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

defaultValue

Summary

Gets or sets the value of the value HTML attribute.

Property of dom/HTMLInputElementdom/HTMLInputElement

Syntax

var defaultValue = inputElement.defaultValue;
inputElement.defaultValue = value;

Return Value

Returns an object of type StringString

The value of the value HTML attribute.

Notes

The value of the property can be changed programmatically, but doing so has no effect on the appearance of the object or the submitted value - if the value property has been changed by a user or by a script. It does, however, change the initial value of the object when the form is reset.

Related specifications

DOM Level 1
Recommendation

See also

Related pages

  • input type=button
  • input type=checkbox
  • input type=file
  • input type=hidden
  • input type=image
  • input type=password
  • input type=radio
  • input type=reset
  • input type=submit
  • input type=text
  • textArea

Attributions