Reputation: 388
Super simple question - I'm new to jQuery so I'm a little bit stupid with it.
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() {
});
});
I have display: none; set on the form so I want to toggle slide up and down. Surely the jQuery is sound as I took it from the documentation. What am I missing?
UPDATE: OK my JSFIDDLE went tits up.
My issue is the code works when the jQuery is inside a script tag on the same page but not working from a linked JS file.
I know the file is linked properly because I have other things going on that work.
Upvotes: 0
Views: 63
Reputation: 198
You did not include the jQuery library.
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
Updated fiddle:
https://jsfiddle.net/ve5f3oeb/3/
Upvotes: 1
Reputation: 773
Can it be that you forgot to include the jQuery library?
Try
https://jsfiddle.net/ve5f3oeb/2/
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
Upvotes: 1