var next = $('#appendExtraAppointments').next('li'); while (next.size() != 0) { next = $('#spc').next('li'); next.remove(); }
Regards, Emil Ivanov On Jun 5, 5:02 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have the following DOM: > > <ul> > <li>blah 1</li> > <li id="appendExtraAppointments">blah 2</li> > <li>blah 3</li> > <li>blah 4</li> > </ul> > > I would like to remove the li elements after the <li > id="appendExtraAppointments">blah 2</li>. > > I tried doing something like this, but it didn't work: > > $('#appendExtraAppointments').siblings().not($('li').prev).remove(); > > Any ideas? > > Thanks!