Reputation: 3915
I'm trying to get the clicked element so that I can add class. Does Meteor provides any way to get the current element like jQuery $ (this)
Template.retraining.events({
'click .myclass': function (event) {
//Get the clicked element like $(this) in jQuery
$().addClass('existing-col');
}
});
Upvotes: 3
Views: 213
Reputation: 247
From this you can get textbox value with one button click event.
Try this:
Template.retraining.events({
'click .myclass':function(e,t){
var val = t.find(".classname").value;
}
Upvotes: 1
Reputation: 87203
To get the element on which the event occurred, use event
object.
event.target
As you've jQuery included, you can wrap the element in jQuery to use jQuery methods on it.
$(event.target)
You can see this in Meteor Tutorial
Upvotes: 5