Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
169
rated 0 times [  175] [ 6]  / answers: 1 / hits: 36428  / 14 Years ago, sun, march 6, 2011, 12:00:00

I have:



<div id=container>
<div id=i_1></div>
<div id=i_2></div>
<div id=i_3></div>
<div id=i_4></div>
</div>


How do I remove everything after $('#i_2')?


More From » jquery

 Answers
41

Use nextAll



$('#i_2').nextAll().remove()

[#93412] Friday, March 4, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
byron

Total Points: 616
Total Questions: 101
Total Answers: 91

Location: Reunion
Member since Wed, Apr 14, 2021
3 Years ago
byron questions
Wed, Jan 26, 22, 00:00, 2 Years ago
Sat, Jun 6, 20, 00:00, 4 Years ago
Thu, Nov 7, 19, 00:00, 5 Years ago
Wed, Sep 11, 19, 00:00, 5 Years ago
;