Input DatetimeLocal readOnly Property - check if a local datetime field is read-only or not: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Datetime Local

Description

Input DatetimeLocal readOnly Property - check if a local datetime field is read-only or not:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<input type="datetime-local" id="myLocalDate" readonly>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {//from   w  w  w  .  j a v  a  2  s  . c  om
    var x = document.getElementById("myLocalDate").readOnly;
    document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>

Related Tutorials