javascript - How to implement the label click event -


i need perform action in label click event in dojo amd module, when click labe not fire in function. sample code given below

 dom.byid("my label id").on("click", function (evt) { // not fire here      function();     }); 

try register onclick :

 require(["dojo/on",    "dojo/dom",    "dijit/registry",    "dojo/domready!"],     function (on, dom, registry) {    on(dom.byid("mylabelid"), "click", function(e){     // handle event      dom.byid("thisisclicked").innerhtml = "i have done it!";   });  }); 

here's fiddle example above: http://jsfiddle.net/y59qz/10/

and tip variablenames - don't use whitespaces in names - write without or if must take underscore. whitespaces in variablenames nogo!

regards, miriam


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -