Javascript examples for DOM HTML Element:Input URL
Input URL value Property - Get the URL of a URL field:
<!DOCTYPE html> <html> <body> Homepage: <input type="url" id="myURL" value="http://www.google.com"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w w w .jav a 2 s .c o m*/ var x = document.getElementById("myURL").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>