CODE CODIFY.CLUB

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($(“.classname.active”));
jQuery(“a.classname:eq(“+ (k +1) + “)”).click();

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

V!ral

Developer, Technology aficionado, Beer Lover and founder of codify.club 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