How to use Input Selector Method in JQuery

This article describe about Input Selector Method in JQuery.
  • 1644

Use :input Selector method in jQuery

In this method, we put input value in the selective element.

The element works with the help of button element.

Input method put the test string in the empty elements.

Example

<!DOCTYPE html>

<html>

<head>

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

<script type="text/javascript">

    $(document).ready(function () {

        $(":input").css("background-color", "blue");

    });

</script>

</head>

<body>

 

 

<form action="">

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

<br />

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

<br />

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

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

<br />

</form>

</body>

</html>

Output1

op1.jpg

Output2

op2.jpg

Output3

op3.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

© 2019 DotNetHeaven. All rights reserved.