Skip to content

Select all between two things? #82

Open
@didibus

Description

I struggle to figure out how to select all elements between two elements such as:

<ul class="pagination">
   <li class="prevnext"><a href="#" onclick="return false;" class="disablelink">&lt;</a></li>
   <li class="current"><a href="/pc-game-pass/games">1</a></li>
   <li><a href="/pc-game-pass/games?page=2" rel="nofollow">2</a></li>
   <li class="h-ellip"><span>...</span></li>
   <li><a href="/pc-game-pass/games?page=3" rel="nofollow">3</a></li>
   <li class="l"><a href="/pc-game-pass/games?page=4" rel="nofollow">4</a></li>
   <li class="prevnext"><a href="/pc-game-pass/games?page=2" rel="nofollow">&gt;</a></li>
</ul>

And I want to select all li elements between the one of class current and the one of class l using hickory selectors, so that I get back:

   <li><a href="/pc-game-pass/games?page=2" rel="nofollow">2</a></li>
   <li class="h-ellip"><span>...</span></li>
   <li><a href="/pc-game-pass/games?page=3" rel="nofollow">3</a></li>

How do you do that?

Thank You

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions