Javatpoint Logo
Javatpoint Logo

jQuery :password selector

The :password selector in jQuery is used to select the input elements with type = "password".

Syntax

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.

Example

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

Output

After the execution of the above code, the output will be -

jQuery :password selector

On clicking the given button, the background-color of the password field will be changed as shown in the below screenshot -

jQuery :password selector





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA