HTML | DOM Input Password defaultValue Property


The DOM Input Password defaultValue Property is used to set or return the default value of the Password Field. This Property is used to reflect the HTML value attribute . The main difference between the default value is that default value indicate the default value specified in the attribute while the value contains the current value after making some changes. This Property is useful when we want to find out whether the Password field have been changed or not.

Syntax:

  • It is used to return the defaultValue property.
    passwordObject.defaultValue
  • It is used to set the defaultValue property.
    passwordObject.defaultValue = value

Property Values: