好的,假设我有一个按钮,我想启用/禁用它的点击处理程序。
我想创建这样的功能:
var bar = [];
function storeHandlers(buttonID) {
//I would like to store the click handlers in bar[buttonID]
}
function preventHandlers(buttonID) {
storeHandlers(buttonID);
//I would like to disable all the click handlers for button
}
function loadHandlers(buttonID) {
//I would like to enable all the handlers loaded from bar[buttonID]
}
这可能吗?我怎样才能做到这一点?
先感谢您