【发布时间】:2015-08-05 00:01:42
【问题描述】:
我有这个 html 结构。
<div class="test">
<input type="text" /> <!-- this input is generated autoamitcally so i cant set id or className -->
</div>
现在我想在输入中使用按键事件,我的eventtype selector 应该是什么样子?
已经尝试过
Template.myTemplate.events({
'keypress .test.input .test input':function(event,template){
console.log("and work"); //this dosnt get printed on the console.
}
})
我知道“按键输入”有效,但我在同一个模板上有另一个输入,所以我只想触发这个输入上的按键。
【问题讨论】: