jQuery 动画不工作/没有错误

jQuery animate not working / no errors

我有这个简单的 jQ 脚本

$(document).ready(function(){
    $('#click').on('click', function(){
        $('#slide').animate({left: "100px"});
    })
});

和HTML

<div id="slide" style="border:2px solid red; width:100px; height:100px; background-color:blue; position:relative; left: -100px;">

</div>
<button id"click">click</button>

div不滑动,不知道是什么问题

我发现 HTML 中的 button 行有问题。目前是:

<button id"click">click</button>

但应该是:

<button id="click">click</button>

id 和它的值之间应该有一个 = 符号。除此之外,其他一切对我来说都很好。您确定您的 jQuery 包含在内了吗?

这是一个 jsFiddle 演示。