In meteor I try to catch click event on a button.
I have :
events = { 'click .plat': function(event, template)
{
console.log("event.target");
console.log(event.target);
id = event.target['data-target'].value;
}
}
But I got an error when executed :
What seems strange to me is that the target is well logged into the console, and we see the "data-target" attribute.
Why can't I access it through [event.target['data-target']' ?
EDIT
Trying :
events = { 'click .plat': function(event, template)
{
console.log("event.target");
console.log(event.target);
console.log(event.target.data);
id = event.target.data('target');
console.log(id);
}
}
Getting :