Reputation: 74
lets say I have something like this:
'click #url_image': function(e) {
var className = $(this).attr("class");
console.log(className);
}
"this" in meteor is the context of the current template, not the actual item which was clicked. how could I get the class or other attribute from the actual click event, in this case the class of #url_image?
Thanks
Upvotes: 1
Views: 3761
Reputation: 6120
Or if you want a no-jQuery solution:
e.currentTarget.getAttribute('class');
Upvotes: 5