How to use placeholder attribute in HTML ?
We know that the placeholder attribute is used to define a hint of what value has to be entered on the input and textarea field. This attribute is used for a better understanding of form structure. It contains a string value that represents the short hint that describes the expected value of an input field/text area. The short hint is displayed in the field before the user enters a value. This attribute is used to better understand from what type of data has to be entered into a particular field.
It can be used in the <input> and <textarea> element.
Example: Below example illustrates the use of the placeholder attributes.
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.