有人知道如何用javascript替换onmousedown的值吗?
例如:
<input style="display:inline" type="text" autocomplete="off" name="endDateAdd" id="endDate" onkeydown="return isNumberKey(event,this)" onmousedown="initCal(this, '{$minCal}', null)" value="{$endDate}">对于上面的代码,我想替换onmousedown="initCal(this, '{$minCal}', null)" to onmousedown="initCal(this, '', null)"。有没有人知道怎么用javascript做这件事?
发布于 2009-12-02 07:40:49
假设您正在讨论当元素已经在页面上时更改元素的事件处理程序:
document.getElementById('endDate').onmousedown= function() {
initCal(this, '', null);
};https://stackoverflow.com/questions/1829720
复制相似问题