Say I’ve got something like:
Paragraph One
<br>
<br>
Paragraph Two
<br>
<br>
Paragraph Three
<br>
<br>
Paragraph Four
<br>
<br>
Paragraph n
<br>
<br>
Is there a jQuery selector that I should be using to target everything from Paragraph two to paragraph n? Once I figure out how to target those paragraphs, I want to set them to hidden.
EDIT: When I mention paragraphs above, I mean to say a paragraph block of text. Not using any p elements currently.
this is what the jquery .slice()
method was designed for.
so
live example:
http://jsfiddle.net/t9Nmy/
NOTE — addClass was to help visualize it,
.hide(), .fadeOut(), etcmay be what youre afteryou could also combine the :gt() and :lt() selectors as follows
$('p:lt(6):gt(3)').addClass('the-class');or just
$('p:gt(2)').hide()