I was using the following jquery code to select the first 10 consecutive elements
$(".pag-num-1").nextAll(".num-btn").slice(0, 9).show();
The problem was, it wasn't selecting the base element i.e. .pag-num-1
element, so what I am doing now is manually displaying the element .pag-num-1
i.e.
$(".pag-num-1").nextAll(".num-btn").slice(0, 10).show();
$(".pag-num-1").show();
I wasn't able to find another to achieve this.
Is there another way that I can select the base element i.e. .pag-num-1
element along with the other elements i.e. using the same line in which I have used nextAll()
? That'd be more cleaner, wouldn't it?