我有三个按钮,点击一个按钮后,第二个必须访问点击,然后第三个。当我点击第三个按钮时,它不应该工作
<input type="button" value="button" id="one" onclick="show()" action="">
<input type="button" value="button" id="two" onclick="show1()">
<input type="action" value="button" id="three">
<script>
function show{
}
</script>
最佳答案
最初禁用第二个和第三个按钮使用:
<input type="button" value="button" id="two" onclick="show1()" disabled="disabled"/>
<input type="action" value="button" id="three" disabled="disabled"/>
并使用此代码:
function show()
{
document.getElementById('two').removeAttribute('disabled');
}
// And Same For Second Button Click
function show1()
{
document.getElementById('three').removeAttribute('disabled');
}
关于javascript - 在javascript中单击另一个按钮后激活按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22349219/