Open In App
Related Articles

HTML DOM Input Email select() Method

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

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">GeeksforGeeks</h1>
 
    <h2>DOM Input Email select() method</h2>
 
     Enter E-mail Address:
     <input type="email" id="email"
            value="careers@geeksforgeeks.org" 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

HTML DOM Input Email select() Method

Supported Browsers:

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


Last Updated : 25 Aug, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads