Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
Homepage: <input type="url" id="myURL">
<p>Click the button to set the URL field to read-only.</p>
<p><strong>Tip:</strong> To see the effect, try to type something in the URL field before and after clicking the button.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
  document.getElementById("myURL").readOnly = true;
}
</script>
</body>
</html>