基本jQuery slideDown()不起作用

Basic jQuery slideDown() not working

本文关键字:不起作用 slideDown jQuery 基本      更新时间:2023-09-26

超级简单的问题-我是jQuery的新手,所以我对它有点笨。

https://jsfiddle.net/ve5f3oeb/

<a href="#" id="forgotten-show">I have forgotten my password ></a></div>
        <form class="forgotten-pw" action=""><!-- This still needs to dropdown from clicking the #forgotten-show link above -->
            <input type="email" placeholder="Your email"><!-- Prefill this field with their email address as they type just in case they have forgotten their email -->
            <div class="row inline-center">
                <input type="submit" value="Send password">
            </div>
            <p class="pw-reminder-sent">Your password has been sent</p>
        </form>
$("#forgotten-show").click(function() {
  $(".forgotten-pw").slideToggle( "slow", function() {
  });
});

我有显示器:没有;设置在窗体上,所以我想上下切换幻灯片。当然,正如我从文档中获得的那样,jQuery是合理的。我错过了什么?

更新:好的,我的JSFIDDLE出现了问题。

我的问题是,当jQuery位于同一页面上的脚本标记内,但不在链接的JS文件中工作时,代码可以工作。

我知道文件链接正确,因为我还有其他工作要做。

可能是您忘记了包含jQuery库吗?

尝试

https://jsfiddle.net/ve5f3oeb/2/

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

您没有包含jQuery库。

<script src="https://code.jquery.com/jquery-2.1.4.js"></script>

更新小提琴:

https://jsfiddle.net/ve5f3oeb/3/