Questions tagged [nextuntil]

A jQuery function that get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.

A jquery function that get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. docs

<dl>
  <dt id="term-1">term 1</dt>
  <dd>definition 1-a</dd>
  <dd>definition 1-b</dd>
  <dd>definition 1-c</dd>
  <dd>definition 1-d</dd>
  <dt id="term-2">term 2</dt>
  <dd>definition 2-a</dd> <!-- Selected -->
  <dd>definition 2-b</dd> <!-- Selected -->
  <dd>definition 2-c</dd> <!-- Selected -->
  <dt id="term-3">term 3</dt>
  <dd>definition 3-a</dd>
  <dd>definition 3-b</dd>
</dl>
$( "#term-2" ).nextUntil( "dt" )
// select any element after #term-2 to next "dt"
33 questions
3
votes
1 answer

Dynamically addClass() to elements depending on the siblings previous class?

I have a
3
votes
4 answers

How to wrap all HTML-Code after until next occurence of

?

19.11.2015:Some text Some text. Again some text!

19.11.2015:Maybe also only…

user3532637
  • 333
  • 3
  • 16
3
votes
1 answer

jQuery, nextUntil(), if element is not a paragraph

I wanna use nextUntil() to make all p's orange which are directly following a h2.first till any other html tag than p arrives.

Lorem ipsum

Lorem ipsum

Lorem ipsum

Lorem ipsum

  • Lorem ipsum
Nele
  • 45
  • 3
2
votes
3 answers

Jquery nextUntil and prevUntil including issue

I am trying to include first and last selectors along with nextUntil and prevUntil JQUERY $('.selectedDay').parent().prevUntil('li.weeks').css('background', '#F00'); $('.selectedDay').parent().nextUntil('li.weeksClose').css('background',…
nani0077
  • 119
  • 14
2
votes
2 answers

jQuery nextUntil attribute is less then or equal to value

I have the following which works OK, but I need adapt it so that it compares the data-folder-level against being less than or greater to. $elem.nextUntil( $("li[data-folder-level="+level+"]"), "li" ).remove(); I tried this... $elem.nextUntil(…
Tom
  • 12,776
  • 48
  • 145
  • 240
2
votes
1 answer
2
votes
1 answer

Is there a better way to detect if nextUntil stopped regularly?

I wonder if there is a well performing way to find out if .nextUntil() stopped without matching the specified selector. .nextUntil() returns the same result as .nextAll() if the selector didn't match any element. So it is possible to find out…
cdMinix
  • 655
  • 1
  • 7
  • 29
1
vote
2 answers

Jquery nextUntil() won't match my elements

document.addEventListener('DOMContentLoaded', function() { collapsed = $(document).find('.off'); collapsed.closest('table').nextUntil('.head', 'tr').not('head').hide(); });
ESB691
  • 81
  • 5
1
vote
2 answers

JQuery .nextUntil() selecting heading into li

I'm trying to select all h3 tags under h2 tags even if into li whether ul or ol in a page, using .nextUntil(). HTML markup is like:

1
vote
1 answer

jQuery nextUntil with child

my html structure is like
00Shunya
  • 85
  • 10
1
vote
1 answer

How to wrap all elements after heading until next heading that's same or higher?

I have content consisting of headings (h1, h2, h3, h4, h5, h6). What I need: Using jQuery, I need to wrap all elements following each heading until the next same heading or higher heading. By "higher", I mean to say: H5 is "higher" than h6. H4 is…
Clarus Dignus
  • 3,847
  • 3
  • 31
  • 57
1
vote
1 answer

How to target nearest class within a container using jquery?

I want to target the nearest class and stop on targeting other class elements if it's the last item to be read on that part. Here is what I am trying to achieve. The .is-child class will show if the .parent class is clicked and only the nearest…
leonardeveloper
  • 1,813
  • 1
  • 34
  • 58
1
vote
2 answers

How to select elements between two "h2" except one element using jquery?

so I'm working with a website that is designed like this:

Explanation

... don't select anything in this table
hey

What's up?

How's life?…

Brian K
  • 548
  • 1
  • 4
  • 17
1
vote
0 answers

How to use nextUntil for children elements?

I have a simple table, and I would like to add a class for the cells between the active class. …
user1452062
  • 805
  • 4
  • 12
  • 27
1
vote
2 answers

How can I each loop through nextUntil

I need to create an array of arrays. I had a pretty extensive if/else cycle working, but I think I can refactor it down using jQueries nextUntil function. Based on what I'm seeing, I'm on the right track, but my results are just shy of what I need…
NominalAeon
  • 593
  • 5
  • 23
1
2 3
col col col col col
col