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