Result Size: 625 x 664
x
 
<!DOCTYPE html>
<html>
<body>
<h2>Use select() to select the content of an Email Field</h2>
E-mail: <input type="email" id="myEmail" value="john@example.com">
<p>Click the button to select the content of the email field.</p>
<button type="button" onclick="myFunction()">Try it</button>
<script>
function myFunction() {
  document.getElementById("myEmail").select();
}
</script>
</body>
</html>