HTML DOM Input Email placeholder attribute
Examples
Modify email field is the expected value of the message:
document.getElementById ( "myEmail") .placeholder = "Your Email address";
try it"
Definitions and use
Placeholder attribute value used to set or return email field placeholder attribute.
placeholder attribute provides a description of the input fields can be expected message.
The prompt is displayed in the input field empty, and disappears when the field gets the focus.
Browser Support
All major browsers support the placeholder attribute.
Note: Internet Explorer 9 and earlier versions of IE do not support the placeholder attribute.
grammar
Back placeholder attributes:
emailObject .placeholder
Setting placeholder properties:
emailObject .placeholder = text
Property Value
value | description |
---|---|
text | Tip description of the expected value of the input field |
technical details
return value: | String that represents the expected value of the input field prompts |
---|
More examples
Examples
Get the expected value of the email field:
var x = document.getElementById ( "myEmail" ) .placeholder;
x The output is:
Email
try it"
Related Pages
HTML Reference Manual: HTML <the INPUT> placeholder attribute