Input Date type Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Date

Description

The type property returns the type of form date element.

Return Value

A String, representing the type of form date element

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

A date control: <input type="date" id="myDate">

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

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

<script>
function myFunction() {/*ww w .ja  va2 s .  c  o m*/
    var x = document.getElementById("myDate").type;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials