 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
jQuery :input Selector
The :input selector in jQuery is used to select all input elements.
Syntax
The syntax is as follows −
$(":input")  Example
Let us now see an example to implement the :input selector −
<!DOCTYPE html> <html> <head> <style>    .demo {       background-color: blue;       color: white;       border: 2px yellow dashed;    } </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script>    $(document).ready(function(){       $(":input").addClass("demo");    }); </script> </head> <body> <h2>Login</h2> <form action=""> Student Name: <input type="text" name="sname"><br> Student ID: <input type="text" name="sid"><br><br> </form> </body> </html> Output
This will produce the following output −

Advertisements
 