Web APIs
HTMLInputElement.defaultValue
Reflect the value attribute, which is the baseline used when a form resets a text input. It can differ from the edited value. Example console output: original edited.
Formal Syntax & Structure
javascript syntaxjavascript
input.defaultValueReturn Value
string
Default value attribute.
Working Example
Example Snippetjavascript
const i=document.createElement("input"); i.defaultValue="original"; i.value="edited"; console.log(i.defaultValue,i.value);