

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
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
How to exclude first and second element from jQuery selector?
To exclude first and second element from jQuery, use the slice() method.
Example
You can try to run the following code to exclude first and element from jQuery:
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $('p').slice(2).css('font-size', '24px'); }); </script> </head> <body> <p>Java</p> <p>C++</p> <p>Ruby</p> <p>Groovy</p> </body> </html>
- Related Questions & Answers
- jQuery :first Selector
- jQuery element Selector
- jQuery :first-child Selector
- How to get a DOM Element from a jQuery Selector?
- jQuery element ~ siblings Selector
- jQuery element + next Selector
- jQuery :first-of-type Selector
- How to combine a class selector and an attribute selector with jQuery?
- MongoDB Aggregate Second Element from Input Element?
- What is the difference between jQuery(selector) and $(selector)?
- jQuery :button Selector
- jQuery :checkbox Selector
- jQuery :checked Selector
- jQuery :contains() Selector
- jQuery :disabled Selector
Advertisements