I have the following markup containing 10 pre elements with the class indent:
pre
indent
You are iterating through the string, you should pass an object or an array to $.each method:
$.each
$(function(){ $.each($(".indent"), function(index){ alert(index); }); });