jquery - Get all next siblings of element -


what best way next siblings of element? not next 1 , not siblings before it?

this way found, there jquery selector it?

$('.someclass').click(function () {     var chosenone = $(this);     $('.someclass').removeclass('extraclass');     chosenone.parent().find('.someclass').each(function () {         var el = $(this).index();         if (el >= chosenone.index()) {             $(this).addclass('extraclass');         }     }); }); 

fiddle

the .nextall() method made this:

chosenone.nextall(".someclass").addback().addclass("extraclass") 

fiddle


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -