Skip to content
Related Articles

Related Articles

HTML DOM Input Email select() Method

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 07 Feb, 2022

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
  • Internet Explorer
  • Firefox
  • Safari
  • Opera

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!