HTML DOM Input Email select() Method

The input email select() method in HTML DOM is used to select the content of the email text field. It is the in-built method of the input email object. 

Syntax:

emailObject.select()

Parameters: It does not accept any parameters. 

Return Value: It does not return any value.

Example: This example uses the input email select() method to select the content inside the email Field.  

HTML




<!DOCTYPE html>
<html>
     
<head>
    <title>
        HTML DOM Input Email select() Method
    </title>
</head>   
 
<body>
 
    <h1 style="color:green">w3wiki</h1>
 
    <h2>DOM Input Email select() method</h2>
 
     Enter E-mail Address:
     <input type="email" id="email"
            value="careers@w3wiki.net" autofocus>
    <br><br>
    <button onclick="mySelect()">
        Select Contents of Email Field!
    </button>   
     
    <!-- Script to select input element with
            type email attribute -->
    <script>
        function mySelect() {
            var em = document.getElementById("email").select();
        }
    </script>
</body>
 
</html>                   


Output:

HTML DOM Input Email select() Method

Supported Browsers:

  • Google Chrome 5
  • Edge 12
  • Firefox
  • Safari
  • Opera 11


Contact Us