Input DatetimeLocal type Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Datetime Local

Description

The type property returns the type of form local datetime field.

Return Value

A String, representing the type of form element the local datetime field is

The following code shows how to return which type of form element the local datetime field is:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

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

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

<script>
function myFunction() {/*from   w ww .  ja  v a  2s.c  o m*/
    var x = document.getElementById("myLocalDate").type;
    document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>

Related Tutorials