var disabledElement = document.getElementById('要禁用事件中,標簽的id'); 獲取到想要禁用事件的標簽元素
這里書寫,要進行的某些操作
disabledElement.removeAttribute('onclick'); //移除點擊事件
downLoadTemplate.setAttribute("要添加的事件","要執行的函數名(里面寫參數)"); //重新設置事件
//列如,要添加點擊事件,之后執行的函數是sendMessage,括號里面是傳遞的參數
downLoadTemplate.setAttribute("onclick","sendMessage('1')");