Input Number step Attribute
Definition and Usage
step
The attribute sets or returns the value of the step attribute of the number field.
The HTML step attribute specifies the valid numeric interval of the number field.
Example: If step="3"
Then the valid numbers can be -3, 0, 3, 6, and so on.
Tip:The step attribute can be used with max and min Use attributes together to create a series of valid values.
See also:
HTML Reference Manual:HTML <input> step Atribute
Example
Example 1
Get the valid numeric interval of the number field:
var x = document.getElementById("myNumber").step;
Example 2
Change the valid numeric interval of the number field:
document.getElementById("myNumber").step = "5";
Syntax
Return the step attribute:
numberObject.step
Set the step attribute:
numberObject.step = number
Halaga ng Atribute
Halaga | Paglalarawan |
---|---|
number | Tinutukoy ang lehitimong tala ng numero ng lehitimong intervalo ng numero na larawan. Ang default ay 1. |
Detalye ng Teknolohiya
Halaga ng pagbabalik: | Ang string na halaga na naglalarawan ng lehitimong tala ng numero ng lehitimong intervalo ng numero na larawan. |
---|
Suporta ng Browser
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Suporta | 10.0 | Suporta | Suporta | Suporta |