jQuery eq() loop -
can me this?
$(document).ready(function(){ $("ul.fam:eq(0) li:eq(2)").addclass("redbold"); });
in code, there way loop or increment '0' value in -> $("ul.fam:eq(0) ? making 0,1,2,3,4,5 , on... , stop loop example when reaches '3'
thank you.
you can use :lt()
(less index) selector, this:
$(document).ready(function(){ $("ul.fam:lt(4) > li:nth-child(3)").addclass("redbold"); });
this same selecting :eq(0)
through :eq(3)
. there's :gt()
selector other way around...you can combine both or .slice()
range.
Comments
Post a Comment