
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML DOM Input Time step Property
The HTML DOM Input Time step property determines the legal intervals for only seconds.
Syntax
Following is the syntax −
- Returning number value
inputTimeObject.step
- Setting step attribute to a number value
inputTimeObject.step = number
Parameters
Parameter number values −
seconds | valid values constitute of those numbers that divide 60 perfectly (eg: 10,15,20) |
Example
Let us see an example of Input Time step property −
<!DOCTYPE html> <html> <head> <title>Input Time step</title> <style> form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } </style> </head> <body> <form> <fieldset> <legend>Time-step</legend> <label for="TimeSelect">Time: </label> <input type="time" id="TimeSelect" step="2"> <input type="button" onclick="changeStep(20)" value="Step to 20"> <input type="button" onclick="changeStep(30)" value="Step to 30"> <div id="divDisplay"></div> </fieldset> </form> <script> var divDisplay = document.getElementById("divDisplay"); var inputTime = document.getElementById("TimeSelect"); divDisplay.textContent = 'The current step is: '+inputTime.step; function changeStep(myStep) { inputTime.step = myStep; divDisplay.textContent = 'The current step is: '+inputTime.step; } </script> </body> </html>
Output
This will produce the following output −
Clicking “Step to 20” button −
Clicking “Step to 30” button −
- Related Articles
- HTML DOM Input Month step Property
- HTML DOM Input Number step Property
- HTML DOM Input Range step property
- HTML DOM Input Date step Property
- HTML DOM Input DatetimeLocal step Property
- HTML DOM Input Week step Property
- HTML DOM Input Time autofocus Property
- HTML DOM Input Time defaultValue Property
- HTML DOM Input Time disabled Property
- HTML DOM Input Time form Property
- HTML DOM Input Time max Property
- HTML DOM Input Time min Property
- HTML DOM Input Time name Property
- HTML DOM Input Time readOnly Property
- HTML DOM Input Time required Property

Advertisements