Code doesnt work outside Code academy


#1


https://www.codecademy.com/en/courses/web-beginner-en-GfjC6/2/3


Hi all, this Jquery code works fine on the excercise, however, when I try to apply it to this testsite it doesnt work 8*( Can anybody help me with this? It's on http://periq.testverdel.nl/ (click on the search-icon, its in the menu on the right...


$(document).ready(function(){
	
	$("#zoekKnop").click(function(){
		$('.zoekBalk').slideToggle('slow');
	});

});


#2

Did you include your jquery code to html file? Try to add before close tag </body>:

<script>
   $(document).ready(function(){
      $("#zoekKnop").click(function(){
         $('.zoekBalk').slideToggle('slow');
      });
   });
</script>

Or it doesn't work how you expect?


#3

Hi, and thanks for your effort :slight_smile: As you can see when you click the magnifying glass, something happens... Only it directly toggles back when you click it... Therefore adding the code directly into my html will most likely not work.. Greets


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.