Prop Text Placeholder
## HTML DOM Input Text placeholder Property
The **placeholder** property of the Input Text object is used to set or return the value of the `placeholder` attribute of a text input field.
The placeholder attribute specifies a short hint that describes the expected value of an input field (e.g., a sample value or a short description of the expected format). This hint is displayed in the input field when it is empty, and disappears when the field gets focus or when the user starts typing.
---
## Syntax
### Return the placeholder property:
```javascript
textObject.placeholder
```
### Set the placeholder property:
```javascript
textObject.placeholder = text
```
### Property Values
| Value | Description |
| :--- | :--- |
| *text* | A string specifying a short hint (a word or a short phrase) that describes the expected value of the text field. |
### Technical Details
| Detail | Description |
| :--- | :--- |
| **Return Value** | A String, representing the short hint text of the input field. |
| **DOM Version** | HTML5 |
---
## Browser Support
The `placeholder` property is supported by all major modern browsers:
* Google Chrome
* Mozilla Firefox
* Apple Safari
* Opera
* Microsoft Edge
*Note: Internet Explorer 9 and earlier versions do not support the placeholder property.*
---
## Code Examples
### Example 1: Set the placeholder text of a text field
This example dynamically changes the placeholder text of an input field using JavaScript.
```html
```
### Example 2: Get the placeholder text of a text field
This example retrieves and displays the current placeholder text of an input field.
```html
```
---
## Related Pages
* HTML Reference: [HTML \ placeholder Attribute](https://www.w3schools.com/tags/att_input_placeholder.asp)
* DOM Reference: (dom-obj-text.html)
YouTip