Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h2>Use select() to select the content of a URL Field</h2>
Homepage: <input type="url" id="myURL" value="https://www.w3schools.com">
<p>Click the button to select the content of the URL field.</p>
<button type="button" onclick="myFunction()">Try it</button>
<script>
function myFunction() {
  document.getElementById("myURL").select();
}
</script>
</body>
</html>