Change for-loop to $.each.