代码如下,实际使用时将alert("xxx")替换为对应操作(确定、撤消、删除)的具体代码
<html><head>
<script>
function clickBtn(obj) {
switch (obj.id) {
case "confirm":
alert("确定")
document.getElementById("cancel").disabled = false
break
case "cancel":
alert("撤消")
document.getElementById("delete").disabled = false
obj.disabled = true
break
case "delete":
alert("删除")
obj.disabled = true
break
}
}
</script>
</head>
<body>
<button id="confirm" onclick="clickBtn(this)">确定</button>
<button id="cancel" onclick="clickBtn(this)" disabled="disabled">撤消</button>
<button id="delete" onclick="clickBtn(this)" disabled="disabled">删除</button>
</body>
</html>
<input type="button" id="btnOk" value="click" >javascript
document.getElementById("btnOk").onclick = function(){
//执行按钮对应的操作
this.disabled=true
var self = this
setTimeout(function(){self.disabled=false},1000*30)
}