将模态登录表单data-dojo-attach-point自定义为id

时间:2017-07-19 18:16:03

标签: javascript html javascript-events dojo

我正在尝试自定义模态登录表单。

如何将data-dojo-attach-point ID应用于document.getElementById('id');,如下所示,以获取按钮ID?

HTML

<div style="text-align:center;">
    <button data-dojo-type="dijit/form/Button" 
        data-dojo-attach-event="onClick:toggleEditing" 
        data-dojo-props="label:'${i18n.labels.startEditing}','class':'success'" 
        data-dojo-attach-point="toggleBTN">
    </button>
</div>

的Javascript

<script>
// Get the modal
var modal = document.getElementById('id01');

// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
    if (event.target == modal) {
        modal.style.display = "none";
    }
}
</script>

0 个答案:

没有答案