var test-form = $(".test-form"); $(test-form).ajaxForm(function(ths) { return function(){ console.log(ths); } }(test-form));