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
Post a Comment