开发者社区 问答 正文

jQuery的prop在chrome下没生效

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

展开
收起
小旋风柴进 2016-05-30 13:34:28 2431 分享 版权
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
    赞同 展开评论
问答分类:
问答标签:
问答地址: