Input Week defaultValue Property - Get the default value of a week field: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Week

Description

Input Week defaultValue Property - Get the default value of a week field:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<input type="week" id="myWeek" value="1995-W35">

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

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

<script>
function myFunction() {/*from w  ww.ja va2s .co m*/
    var x = document.getElementById("myWeek").defaultValue;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials