jQuery nextUntil method


jQuery “nextUntil()” is used to get the next siblings of the matched elements.


Syntax : jQuery nextUntil() method

$(selector).nextUntil(selector-element,filter);

selector-element : selector-element is stop point.

jQuery nextUntil Method Example

jQuery nextUntil() Method – Example 1

<script type="text/javascript">
         $(document).ready(function(){ 
              $( "#selectNext" ).on( "click", function(event) {             
                 $(".start-selection").nextUntil(".stop-selection").css("border","1px solid red");
              });
               
          });
</script>

Try it »


Advertisements

Add Comment

📖 Read More