jQuery :password selector
The :password selector in jQuery is used to select the input elements with type = "password".
The commonly used syntax of using the :password selector is given as follows -
Let's see an illustration to understand the working of the :password selector.
It is a simple example of using the :password selector. In this example, there are two input fields one is of type = "text", and the other one is of type = "password". On clicking the given button, the :password selector will select the input field with the type = "password".Test it Now
After the execution of the above code, the output will be -
On clicking the given button, the background-color of the password field will be changed as shown in the below screenshot -