The type
property returns the type of the URL field.
type |
Yes | 10.0 | Yes | Yes | Yes |
var v = urlObject.type
A String type value representing the type of the URL field.
The following code shows how to get the type of the URL field.
<!DOCTYPE html>
<html>
<body>
<!-- w ww .j a v a 2s. co m-->
Homepage: <input type="url" id="myURL">
<button onclick="myFunction()">test</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myURL").type;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
The code above is rendered as follows: