Authors:Bill Keese
Project owner:Bill Keese


dijit._OnDijitClickMixin is a useful mixin for widgets that need to be accessible, that require nodes to be “clicked” via the keyboard in addition to via the mouse(or a touch event).

For example, in the code below the user can tab to the <span> node and press either the ENTER or SPACE key, and it will have the same effect as clicking the span with the mouse:

], function(_WidgetBase, _TemplatedMixin, _OnDijitClickMixin, declare, dom){
    var MyButton = declare([_WidgetBase, _TemplatedMixin, _OnDijitClickMixin], {
        templateString: "<span tabIndex=0 data-dojo-attach-event='ondijitclick: onClick'>click me</span>",
        onClick: function(evt){
    new MyButton({}, dom.byId("myButton"));
<div id="myButton">this will be replaced by the widget</div>
Error in the documentation? Can’t find what you are looking for? Let us know!