Returns the error message that would be displayed if the user submits the form, or an empty string if no error message.
Property of dom/HTMLInputElementdom/HTMLInputElement
SyntaxNote: This property is read-only.
var validationMessage = inputElement.validationMessage;
Return Value
Returns an object of type StringString
The error message that would be displayed if the user submits the form, or an empty string if no error message.
NotesReturns a string containing the standard or custom error message that would be displayed if the user submitted at this time. If no errors are present or the form would validate, an empty string is returned. The following example has a required field, and if the user types “fun” into it, a custom message is set. Try previewing without anything in the field, then enter values, including the word fun: Note For more code samples, see Form controls part 1 and Form controls part 2: validation on the Windows Internet Explorer sample site.
Related specificationsMicrosoft Developer Network: [Windows Internet Explorer API reference Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4