jQuery find next similar class element to currently active class

To find next similar class to currently active class you can use following jquery code.

var k = jQuery(“.classname”).index($(“”));
jQuery(“a.classname:eq(“+ (k +1) + “)”).click();

1) “classname” and “active” are both class name
2) :eq = equivalent  used to find similar property


Developer, Technology aficionado, Beer Lover and founder of Network. Who shares a keen interest about website development, health issues, cancer awareness and other fun stuff.

Add comment

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.

Most popular

Most discussed