I need to select all a tags from <a class="self"> to <a class="next">. Here is example
<span class="pages">
<a class="prev"> </a>
<a>13</a>
<a>14</a>
<a>15</a>
<a>16</a>
<a class="self">17</a>
<a>18</a>
<a>19</a>
<a>20</a>
<a>21</a>
<a class="next"> </a>
</span>
There are hrefs attributes. I don't want to get anything before class self. I want everything from self to end of the span element.
nextUntil [docs] would get all a elements between a.self and a.next, excluding them:
$('a.self').nextUntil('a.next', 'a');
If you want to include them, just use .nextAll [docs]:
$('a.self').nextAll('a').andSelf();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With