If you want the actual alternative to be $ .each (), just use the for loop:
var liElements = $('ul li'); for (var i = 0; i < liElements.length; ++i) { var li = liElements[i];
Suggestions that you can skip ".each ()" and just use ".hover ()" are correct, but they miss the point: these jQuery procedures will execute ".each ()" internally anyway.
I doubt that the transition from $ .each () to the for loop will itself be of great significance.
Pointy
source share