The type
property returns the type of the local datetime field.
type |
Yes | No | No | Yes | Yes |
var v = datetimelocalObject.type
A String type value representing the type of the local datetime field.
The following code shows how to get the type of the local datetime field.
<!DOCTYPE html>
<html>
<body>
<input type="datetime-local" id="myLocalDate">
<button onclick="myFunction()">test</button>
<p id="demo"></p>
<script>
function myFunction() {<!--from w w w . ja va 2s . c om-->
var x = document.getElementById("myLocalDate").type;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
The code above is rendered as follows: