All you need is general sibling combinator like this:
$('#appendExtraAppointments ~ li').remove(); More info on the selector. http://www.w3.org/TR/2005/WD-css3-selectors-20051215/#general-sibling-combinators http://docs.jquery.com/DOM/Traversing/Selectors -- Brandon Aaron On 6/5/07, [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!