MeteorJS: How to get clicked element

前端 未结 2 1350
慢半拍i
慢半拍i 2021-01-20 16:59

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.retrain         


        
2条回答
  •  醉酒成梦
    2021-01-20 17:26

    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;
    }
    

提交回复
热议问题