开发者社区> 问答> 正文

jQuery的prop在chrome下没生效

`$("#sth").prop("disabled",false);
$("#sth").prop("disabled",true);`
在IE、FF下有效,在Chrome下无效,select、button都没有用。。。

展开
收起
小旋风柴进 2016-05-30 13:34:28 2246 0
1 条回答
写回答
取消 提交回答
  • 我试过了是可以的呀, 你再试下吧, 确认引入了最新的jquery库

    <script src="http://cdn.bootcss.com/jquery/2.2.0/jquery.min.js"></script>
    <!-- ... -->
    
    <button type="button" name="button" id="sth"> 点我! </button>
    
    <script>
        $("#sth").prop("disabled",true);
        $("#sth").attr("disabled",true);
    2019-07-17 19:20:25
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关课程

更多

相关电子书

更多
23-Vue.js在前端...1506518547.pdf 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载