Edit This Code:
<!DOCTYPE html>
<html>
<body>

Homepage: <input type="url" id="myURL" value="http://www.google.com">

<p>Click the button to change the default value of the URL field.</p>

<button type="button" onclick="myFunction()">Try it</button>

<p><strong>Note:</strong> elements with type="url" are not supported in IE 9 (and earlier), or Safari.</p>

<script>
function myFunction() {
    document.getElementById("myURL").defaultValue = "http://www.cnn.com";
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy