Javascript examples for DOM HTML Element:Input URL
The type property returns the type of form URL field.
For an input type="url", it will always return "url".
A String, representing the type of form element the URL field is
The following code shows how to return which type of form element the URL field is:
<!DOCTYPE html> <html> <body> Homepage: <input type="url" id="myURL"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/* w w w .j ava2 s . com*/ var x = document.getElementById("myURL").type; document.getElementById("demo").innerHTML = x; } </script> </body> </html>