Code doesnt work outside Code academy

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/en/courses/web-beginner-en-GfjC6/2/3

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
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');
});

});

<do not remove the three backticks above>
1 Like

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?

1 Like

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

1 Like

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