Change the placeholder text of a search field:
The placeholder property sets or returns the value of the placeholder attribute of a search field.
The placeholder attribute specifies a short hint that describes the expected value of a search field (e.g. a sample value or a short description of the expected format).
The short hint is displayed in the text field before the user enters a value.
The placeholder property is supported in all major browsers.
Note: The placeholder property is not supported in Internet Explorer 9 and earlier versions.
Return the placeholder property:
Set the placeholder property:
|text||Specifies a short hint (one word or a short phrase) that describes the expected value of the search field|
|Return Value:||A String, representing a short hint that describes the expected value of the search field|
Get the placeholder text of a search field:
The result of x will be:
HTML reference: HTML <input> placeholder attribute