Javascript DOM HTML Input DatetimeLocal step Property get

Introduction

Get the legal number intervals for seconds in a local date field:

var x = document.getElementById("myLocalDate").step;

Click the button to display the value of the step attribute of the local datetime field.

View in separate window

<!DOCTYPE html>
<html>
<body>

Date: <input type="datetime-local" id="myLocalDate" step="5">
<button onclick="myFunction()">Test</button>
<p id="demo"></p>

<script>
function myFunction() {//ww w  .ja  v  a2s . co  m
  var x = document.getElementById("myLocalDate").step;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>



PreviousNext

Related