I use aspnetmvcturbolinks in own project but, the jquery api that written in body is undefined. I move js files to head of layout .
$(document).on('keyup', 'input[name=keyword]', function () {
alert(this.attr("name"));
return false;
});
in this above code attr api is undefind!! what is solution? thanks.
It's because you have to pass this
to jQuery to use jQuery methods...
$(this).attr("name")
... else it looks into the object and returns undefined