我有一个使用dojotype
属性的 html 按钮:
<button id="btnSearchEmployees" dojotype="dijit.form.Button">
Search
</button>
并尝试使用 jQuery 处理此按钮上的单击事件:
$("#btnSearchEmployees").click(function() {
alert("test");
});
但它不起作用,如果我取出dojotype
属性,它可以正常工作:
<button id="btnSearchEmployees"> Search </button>
我怎样才能避免这种情况?
编辑:这是道场的变化:
<span class="dijit dijitReset dijitInline dijitButton" role="presentation" style="width: 70px;" widgetid="btnSearchEmployee">
<span class="dijitReset dijitInline dijitButtonNode" data-dojo-attach-event="ondijitclick:_onClick" role="presentation">
<span class="dijitReset dijitStretch dijitButtonContents" data-dojo-attach-point="titleNode,focusNode" role="button" aria-labelledby="btnSearchEmployee_label" tabindex="0" id="btnSearchEmployee">
<span class="dijitReset dijitInline dijitIcon dijitNoIcon" data-dojo-attach-point="iconNode"></span><span class="dijitReset dijitToggleButtonIconChar">?</span>
<span class="dijitReset dijitInline dijitButtonText" id="btnSearchEmployee_label" data-dojo-attach-point="containerNode">Search</span>
</span>
</span>
<input type="button" value="" class="dijitOffScreen" tabindex="-1" role="presentation" data-dojo-attach-point="valueNode">
</span>