i put this in my html

<div class=“testclass”>
testclass click

and this in the js.


"click .testclass": function (event) {



–> it works fine.

but i am using this class in many templates, so i figured i use template.body.events instead (like in the tutorial with a form):


"click .testclass": function (event) {



–> nothing happens.
so template.body.events is not a way to globally ‘listen’ to events?
how is it then possible to create a class and assign it a behaviour throughout many templates?
otherwise i would have to write the same code for multiple templates.

thanks in advance.


The answer there is meteor add gwendall:body-events. Always works for me.


cool, now it works. many thanks!!!

template.body is used in the tutorial with a form, there is no hint to it being restricted to forms or whathaveyou.