Using dojo 1.9, I'm trying to access the value of a checkbox not like in the example in the docs:
require(["dijit/form/CheckBox", "dojo/domReady!"], function(CheckBox){
var checkBox = new CheckBox({
name: "checkBox",
value: "agreed",
checked: false,
onChange: function(b){ alert('onChange called with parameter = ' + b + ', and widget value = ' + this.get('value') ); }
}, "checkBox");
});
but by moving onChange event to:
query('#checkBox').on('change', function(){
var value = query(this).attr('value');
});
or anything similar. I just want to access it from on() method. But I get the same value every time - checkbox is checked. Any ideas?