How to use Password Selector Method in JQuery

This article describe about Password Selector Method in JQuery.
  • 1770

Use :password Selector method in jQuery

We select specified input elements with type="password".

This method put the password test value for input element.

Example

<!DOCTYPE html>

<html>

<head>

<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript">

    $(document).ready(function () {

        $(":password").css("background-color", "red");

    });

</script>

</head>

<body>

<form action="">

Name: <input type="text" name="user" />

<br />

Password: <input type="password" name="password" />

<input type="reset" value="Reset" />

<input type="submit" value="Submit" />

<br />

</form>

</body>

</html>

Output

op1.jpg

You may also want to read these related articles here

Ask Your Question

Got a programming related question? You may want to post your question here

Programming Answers here

© 2020 DotNetHeaven. All rights reserved.