Open In App

HTML | DOM Input Password select() Method

Last Updated : 25 Aug, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The Input Password select() Method in HTML DOM is used in selecting the content of the password field

Syntax:

passwordObject.select()

Parameters: It does not accepts any parameter. 

Return Value: It does not return any value. 

Example: This example uses Input Password select() Method to select password. 

HTML




<!DOCTYPE html>
<html>
<head>
    <title>
        HTML DOM Input Password select() Method
    </title>
</head>
<body>
    Enter Username:
    <input type="text"
           value="usename">
    <br>
    <br> Enter Password:
    <input type="password"
           value="geeks"
           id="passwd">
    <br>
    <br>
    <button onclick="myGeeks()">
      Click Here!
      </button>
    <script>
        function myGeeks() {
            document.getElementById(
              "passwd").select();
        }
    </script>
</body>
</html>


Output: 

Before Click on button:

  

After Click on button:

  

Supported Browsers: The browser supported by Input Password select() Method are listed below:

  • Google Chrome 1+
  • Edge 12+
  • Firefox 1+
  • Safari 1+
  • Opera 2+

Similar Reads

HTML DOM Input Text select() Method
The DOM Input select() method selects all the text content of a textarea or an input element that contains the text field. Syntax: element.select(); Parameters: This method does not accept any parameters. Example: This example selects the content of the input text field. C/C++ Code &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt; HTML
1 min read
HTML DOM Input Datetime select() Method
The input Datetime select() method in HTML DOM is used in selecting the content of the Datetime Text field. Syntax: Datetimebject.select()Parameters: It does not accept any parameter. Example: This example uses the input Datetime select() method to select the Datetime field. C/C++ Code &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;style&gt; h
1 min read
HTML DOM Input URL select() Method
The HTML &lt;input type=”url”&gt; is used to define a field that entered a URL. This input value is automatically validated before submitting the form. The input URL select() method in HTML DOM is used to select the content of a URL text field. It is an in-built method of input URL Object. Refer to components of a URL from the given link Approach:
2 min read
HTML DOM Input Month select() Method
The input Month select() method in HTML DOM is used in selecting the content of the month text field. Syntax: monthObject.select() Parameters: It does not accept any parameter. Return Value: It does not return any value. Example: This example uses the input Month select() method to select the content inside the month Field. C/C++ Code &lt;!DOCTYPE
1 min read
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 conte
1 min read
HTML DOM Input Search select() Method
The Input Search select() Method in HTML DOM is used to select the content of the Input search text field. It is the predefined method of the Search object. Syntax: searchObject.select()Parameters: It does not accept any parameter.Return Value: It does not return any value. Example: This example uses the Input Search select() method to select the c
1 min read
HTML DOM Input Number select() Method
The Input Number select() Method in HTML DOM is used to select the contents of the Input Number field. it is the in-built method of the Number Object. Syntax numberObject.select() Parameters: This method does not contain any parameters. Return Value: This method does not return any value. Example: Below HTML code illustrate the use of input number
1 min read
HTML DOM Input Time select() Method
The input Time select() method in HTML DOM is used in selecting the content of the time text field. Syntax: timeObject.select() Parameters: It does not accept any parameter. Return Value: It does not return any value. Example: This example uses the input Time select() method to select the content inside the time Field. C/C++ Code &lt;!DOCTYPE html
1 min read
HTML DOM Input Week select() Method
The input week select() method in HTML DOM is used in selecting the content of the week field. Syntax: weekbject.select() Parameters: It does not accept any parameter. Example: This example uses the input week select() method to select the week field. C/C++ Code &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;HTML DOM Input Week select
1 min read
HTML DOM Input Date select() Method
The Input Date select() Method in HTML DOM is used to select the contents of the Date text field. It is the predefined method of the Input date object. Syntax: dateObject.select() Parameter: This method does not contain any parameters. Return Values: It does not return any value. Example: Below example illustrates the use of the Input Date select()
1 min read
Article Tags :