The type
property returns the type of the date field.
type |
Yes | No | No | Yes | Yes |
var v = inputdateObject.type
A String type value representing the type of the date field.
The following code shows how to get the type of a date field.
<!DOCTYPE html>
<html>
<body>
<!-- w ww . j a v a2s . c o m-->
A date control: <input type="date" id="myDate">
<button onclick="myFunction()">test</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myDate").type;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
The code above is rendered as follows: