jQuery | :password Selector
The :password Selector is used to select the input element having password field . i.e (type==password)
Syntax:
$(":password")
Example:
<!DOCTYPE html> <html> <head> <script src= </script> <script> $(document).ready(function() { $(":password").css("background-color", "green"); }); </script> </head> <body> <center> <h1 style="color:green;"> GeeksForGeeks </h1> <h2>jQuery :password Selector </h2> <form action=""> Name: <input type="text" name="user"> <br> Password: <input type="password" name="password"> <br> <br> <input type="reset" value="Reset"> <input type="submit" value="Submit"> <br> </form> </body> </html> |
chevron_right
filter_none
Output:

Supported Browsers: The browser supported by jQuery :password Selector are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Recommended Posts:
- jQuery | * Selector
- jQuery | :last Selector
- jQuery | #id Selector
- jQuery | :contains() Selector
- jQuery | :odd Selector
- jQuery | :not() Selector
- jQuery | :first Selector
- jQuery | :gt() Selector
- jQuery | :even Selector
- jQuery | :lt() Selector
- jQuery | :has() Selector with example
- jQuery | [attribute~=value] Selector
- jQuery | [attribute|=value] Selector
- jQuery | element + next Selector
- jQuery | :hidden Selector
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



