Search code examples
javascriptjquerydojodom-events

dojo equivalent for event .change()


What is the equivalent code in dojo for this snippet of jQuery?

 $(".box").change(function() { }

Solution

  • Dojo uses Qt based connect/disconnect event handling.

    dojo.query(".box").connect("onchange", function(){});
    

    or more familiar to jQuery

    dojo.query(".box").onchange(function(){});
    

    see the section "events" in http://dojotoolkit.org/documentation/tutorials/1.6/using_query/