I have this code now
var i,
$spanc = jQuery("#menu").find("span").filter(":not(.stepnumber)");
for(i in $spanc){
$spanc.eq(i).attr("title", $spanc.eq(i).text());
}
is there a way I can make it simpler?
Thanks for any suggestion or help
Yep:
You can use
.each()to iterate over a jQuery collection.thisrefers to the current object in the loop. You can also combine selectors into one string,$('#menu span')is the same thing as$('#menu').find('span').