HTML DOM इनपुट टाइम स्टेप प्रॉपर्टी केवल सेकंड के लिए कानूनी अंतराल निर्धारित करती है।
सिंटैक्स
निम्नलिखित वाक्य रचना है -
- लौटाने वाला नंबर मान
inputTimeObject.step
- सेटिंग चरण विशेषता एक संख्या मान के लिए
inputTimeObject.step = number
पैरामीटर
पैरामीटर संख्या मान -
| सेकंड | मान्य मान उन संख्याओं से बनते हैं जो 60 को पूर्ण रूप से विभाजित करते हैं (उदा:10,15,20) |
उदाहरण
आइए इनपुट समय चरण . का एक उदाहरण देखें संपत्ति -
<!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> आउटपुट
यह निम्नलिखित आउटपुट देगा -
“चरण 20” . पर क्लिक करना बटन -

“30 से चरण” . पर क्लिक करना बटन -
