I think it should be `var elm = $(this)` as you do below.