javascript - 按钮输入上的 CSS 取消 jQuery 中的 prop disabled 属性

标签 javascript jquery html css button

我为输入按钮制作了一些 CSS 样式。这样做之后,prop('disabled',true) 对我不起作用(它曾经在 CSS 更改之前起作用)

HTML代码:

<div id="navigation">
<button id="nextButton" type="button" name="nextButton">Next</button>
</div>

jQuery 代码:

$('#nextButton').prop('disabled',true);

CSS 代码:

button{
    background:    #cfe2f3;
    background:    -webkit-linear-gradient(#cfe2f3, #d0e0e3);
    background:    linear-gradient(#cfe2f3, #d0e0e3);
    border:        0.5px solid #000;
    border-radius: 5px;
    color:         #000;
    display:       inline-block;
    padding:       8px 20px;
    font:          normal 700 18px/1 "Calibri", sans-serif;
    text-align:    center;
    text-shadow:   none;
}

我建议它禁止按下“下一步”按钮

最佳答案

尝试为禁用状态添加一些 CSS:

button:disabled {
    // your css rules
}

关于javascript - 按钮输入上的 CSS 取消 jQuery 中的 prop disabled 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35310803/

相关文章:

javascript - 从 asp 菜单项触发弹出消息

javascript - 带有示例的基本 Bootstrap 提前输入

javascript - jquery 表过滤器脚本不工作

jquery - Silverlight 和 "z-index"

javascript - 使用 Jquery 处理选择框值

javascript - 如何在重新加载时加载不同的 div(按重复顺序)

javascript - SVG/矢量图室内导航路由

javascript - 已选择行选择时选中/取消选中复选框

html - 带有 CSS 的图像周围的标题和内容

jquery - 如何使用 jquery tocify 或 bootstrap toc 修复内容 div 高度