Input Week type Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Week

Description

The type property returns the type of form week field.

Return Value

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

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<input type="week" id="myWeek">

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

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

<script>
function myFunction() {/*from  w  w  w  . jav  a2 s  . c o m*/
    var x = document.getElementById("myWeek").type;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials