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 using:
if ($("#id").nextUntil(".someclass").length === $("#id").nextAll().length) {
//do some stuff if there was no match
}
But is there a better solution?