-2
我想单击第一个按钮,然后激活第二个按钮。第二个按钮激活后,第一个按钮将被禁用。我写了下面的代码,但它不起作用。哪里有问题?单击一个按钮,然后激活另一个按钮
<!DOCTYPE html>
<html>
<head>
<title>Edit Page</title>
</head>
<body>
<input type="submit" name="submit" value="button1" id="bt1">
<input type="button" name="button" value="button2" id="bt2" disabled="disabled">
</body>
<script>
$(function(){
$("#bt1").click(function(){
$(this).attr("disabled", "disabled");
$("#bt2").removeAttr("disabled");
});
$("#bt2").click(function(){
$(this).attr("disabled", "disabled");
$("#bt1").removeAttr("disabled");
});
});
</script>
</html>
你din't加入jQuery库file.That拨弄https://jsfiddle.net/vg76h03q/。它的工作完全是这个问题只有 –
在这里你去 – Shiladitya
我忘记了。感谢您记住我:) – Susant