87,994
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="https://cdn.bootcss.com/jquery/3.1.0/jquery.js"></script>
</head>
<body>
<button id="btn_before">test</button>
<button id="btn">test</button>
<script>
$("#btn_before").hide();
$("#btn").click(function() {
var btn_disabled = $("#btn").attr("disabled");
if(btn_disabled == undefined || btn_disabled == false){
$("#btn").attr("disabled",true);
$("#btn_before").css({"display":"block","position":"absolute","color":"rgba(0,0,0,0.3)"})
}else{
$("#btn").attr("disabled", false);
}
});
$("#btn_before").click(function() {
$("#btn_before").css({"display":"none"});
$("#btn").attr("disabled", false);
})
</script>
</body>
</html>