0
view.when(function(){
    view.on("click", function () { doSomething = !doSomething;});      
});

The above works as a global click event. HOWEVER, I am trying to specify a specific div elem not a global elem. i.e. The logic I'd like:

view.when(function(){
    view.on("click", #myDivElm function () { doSomething = !doSomething;});        
});

1 Answer 1

0

You can set a click event for the element itself.

var myElement = dom.byId("myElement");
on(myElement, "click", function(evt){
  doSomething = !doSomething;
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.