- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 766 Articles for JQuery
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
161 Views
The :radio selector in jQuery is used to select input elements with type radio.SyntaxThe syntax is as follows −$(":radio")ExampleLet us now see an example to implement the jQuery :radio selector − $(document).ready(function(){ $(":radio").wrap(""); }); Register Username: Set Password: Reserved: Unreserved Submit OutputThis will produce the following output −
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
64 Views
The :password selector in jQuery is used to select input elements with type password.SyntaxThe syntax is as follows −$(":password")ExampleLet us now see an example to implement the jQuery :password selector − .one { background-color: blue; color: white; font-size: 18px; border: 2px blue dashed; } $(document).ready(function(){ $(":password").addClass("one"); }); Login Username: Password: Submit OutputThis will produce the following output −
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
135 Views
The :parent selector in jQuery is used to select all elements that are the parent of another element.SyntaxThe syntax is as follows −$(":parent")ExampleLet us now see an example to implement the jQuery :parent selector − .one { background-color: blue; color: white; font-size: 18px; border: 2px blue dashed; } $(document).ready(function(){ $("th:parent").addClass("one"); }); Result Rank Player 1 100 Virat Kohli 2 80 Steve Smith 3 75 David Warner 4 60 Kane Williamson 5 50 Ben Stokes 6 45 Rohit Sharma OutputThis will produce the following output −
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
87 Views
The :only-of-type selector in jQuery is used to select elements which are the only child of its type of its parent.SyntaxThe syntax is as follows −$(":only-of-type")ExampleLet us now see an example to implement the jQuery :only-of-type selector − .one { color: white; background-color: orange; font-size: 16px; border: 2px blue dashed; } $(document).ready(function(){ $("p:only-of-type").addClass("one"); }); Match Details One Two Date: 29th October 2019 Timings: 3PM TO 8PM Ground: DY Patil Match Cancelled Ground: Indore Stadium Date: 29th October 2019 Timings: 8PM TO 11PM Ground: Eden Gardens Date: 30th October 2019 Three OutputThis will produce the following output −
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
217 Views
The :only-child() selector in jQuery is used to select elements that is the only child of its parent.SyntaxThe syntax is as follows −$(":only-child")ExampleLet us now see an example to implement the jQuery :only-child() selector − .one { color: white; background-color: orange; font-size: 16px; border: 2px blue dashed; } $(document).ready(function(){ $("p:only-child").addClass("one"); }); Match Details One Two Date: 29th October 2019 Timings: 3PM TO 8PM Ground: DY Patil Entry begins 2PM Date: 29th October 2019 Timings: 8PM TO 11PM Ground: Eden Gardens Country: India Date: 30th October 2019 Three OutputThis will produce the following output −
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
55 Views
The :odd selector in jQuery is used to select odd elements i.e. with odd index number.Note − The :odd selector deprecated in jQuery 3.4SyntaxThe syntax is as follows −$(":odd")ExampleLet us now see an example to implement the :odd() selector − .one { background-color: blue; color: white; font-size: 18px; border: 2px blue dashed; } $(document).ready(function(){ $("tr:odd").addClass("one"); }); Result Rank Points Player 1 100 Virat Kohli 2 80 Steve Smith 3 75 David Warner 4 60 Kane Williamson 5 50 Ben Stokes 6 45 Rohit Sharma OutputThis will produce the following output −
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
164 Views
The :nth-of-type() selector in jQuery is used to select all elements that are the nth child of a particular type of their parent.SyntaxThe syntax is as follows −:nth-of-type(n|even|odd|formula)Above, the n parameter is the index of each child to match. The even parameter selects even child element, whereas odd selects odd child element.ExampleLet us now see an example to implement the jQuery :nth-of-type() selector − .one { color: white; background-color: orange; font-size: 16px; border: 2px blue dashed; } $(document).ready(function(){ ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
88 Views
The :nth-last-of-type() selector in jQuery is used to select all elements that are the nth child, counting from the last child.SyntaxThe syntax is as follows −:nth-last-of-type(n|even|odd|formula)Above, the n parameter is the index of each child to match. The even parameter selects even child element, whereas odd selects odd child element.ExampleLet us now see an example to implement the jQuery :nth-last-of-type() selector − .one { color: white; background-color: orange; font-size: 16px; border: 2px blue dashed; } $(document).ready(function(){ $("p:nth-last-of-type(2)").addClass("one"); ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
215 Views
The :nth-last-child() selector in jQuery is used to select all elements that are the nth child, counting from the last child.SyntaxThe syntax is as follows −:nth-last-child(n|even|odd|formula)Above, the n parameter is the index of each child to match. The even parameter selects even child element, whereas odd selects odd child element.ExampleLet us now see an example to implement the jQuery :nth-last-child() selector − .one { color: white; background-color: green; font-size: 16px; border: 2px blue solid; } $(document).ready(function(){ ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
478 Views
The :nth-child() selector in jQuery is used to select all elements that are the nth child, regardless of type, of their parent.SyntaxThe syntax is as follows −:nth-child(n|even|odd|formula)Above, the n parameter is the index of each child to match. The even parameter selects even child element, whereas odd selects odd child element.ExampleLet us now see an example to implement the jQuery :nth-child() selector − .one { color: white; background-color: green; font-size: 16px; border: 2px blue solid; } $(document).ready(function(){ ... Read More