Javascript examples for DOM HTML Element:Input URL
The Input URL object represents an HTML <input> element with type="url".
You can access an <input> element with type="url" by using getElementById():
<!DOCTYPE html> <html> <body> <input type="url" id="myURL" value="http://www.java2s.com"> <button onclick="myFunction()">get the URL of the URL field</button> <p id="demo"></p> <script> function myFunction() {//from w ww . ja v a2 s .c o m var x = document.getElementById("myURL").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>