Input Month type Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Month

Description

The type property returns the type of form element month field.

Return Value

A String, representing the type of form element the month field is

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<input type="month" id="myMonth">

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

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

<script>
function myFunction() {/* www  . j av a 2  s.  c  o m*/
    var x = document.getElementById("myMonth").type;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials