Replace for statement for jQuery Each.