A couple questions:
-
Is a regular javascript loop (to loop through a series of elements) faster/more efficient than using jQuery
each()?? -
If so, what is the best way to write the following code as a regular javascript loop?
$('div').each(function(){ //... })
Yes, removing the
each()will give you slightly better performance. This is how you could write a for loop for a list of elements.