javascript - 在javascript中单击另一个按钮后激活按钮

标签 javascript jquery html

我有三个按钮,点击一个按钮后,第二个必须访问点击,然后第三个。当我点击第三个按钮时,它不应该工作

<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/

相关文章:

javascript - 我可以将 HTML 元素绑定(bind)到 js 函数(而不是其他方式)吗?

javascript - 调整 Colorbox 大小不起作用!

javascript - 侧边栏和主页持久性 - Rails

Javascript:IE event.preventDefault 为 null 或不是对象

javascript - 如何通过更改 html 表单中的选择选项来更改变量?

jquery - 如何在div中打洞?

javascript - 我们可以访问 DOM 元素而不将其加载到无限滚动的网页中吗?

javascript - jQuery 跨度类选择器

javascript - 如何以编程方式播放刚在HTML5中录制的webm音频?

javascript - 如何并排放置 2 个 div(替代解决方案)