YouTip LogoYouTip

Prop Number Placeholder

# Input Number placeholder Property [![Image 8: Input Number Object Reference](#) Input Number Object](#) ## Example Change the placeholder text for a number field: document.getElementById("myNumber").placeholder = "Amount"; [Try it Β»](#) * * * ## Definition and Usage The placeholder property sets or returns the placeholder attribute of a number field. The placeholder property provides a short hint that describes the expected value of an input field. The hint is displayed in the field before the user enters a value. The hint disappears when the field gets focus. * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) The placeholder property is supported in all major browsers. **Note:** Internet Explorer 9 and earlier do not support the element with type="number". * * * ## Syntax Return the placeholder property: _numberObject_.placeholder Set the placeholder property: _numberObject_.placeholder=_text_ ## Property Values | Value | Description | | --- | --- | | _text_ | A short hint that describes the expected value of a number field (a word or a short phrase) | ## Technical Details | Return Value: | A String, representing the short hint that describes the expected value of a number field | | --- | * * * ## More Examples ## Example Get the placeholder text for a number field: var x = document.getElementById("myNumber").placeholder; The _x_ output will be: Quantity [Try it Β»](#) * * * ## Related Pages HTML reference: (#) * * Input Number Object](#)
← Prop Number ReadonlyProp Number Name β†’