de`code;

de`code;

Share this

Meteor : Template events to jquery object

How do we get an object triggered an event on DOM.

Like any DOM events, event.target gives the DOM object that fired an event, so this is we can use it here.

Template.top_nav.events({

'mousedown, .nav li a': function(evt){

console.log(‘the class of object that was clicked is ‘+$(evt.target).attr(“class”))

}

})