What the F is going on?!! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What the F is going on?!!

Hello, My name is Jesse Koops and I want to be a freelance graphic, web and ui-designer. Im a bit of a noob When working with JavaScript and Im trying to learn the basics of it and other programms like PHP with this app And it’s community. Now my first question to this community is: Why won’t my hamburger icon open Its content? I inserted my code here: https://code.sololearn.com/WKzZu3MHVGDg/?ref=app

4th Jan 2019, 5:47 PM
Jesse Koops
Jesse Koops - avatar
7 Answers
+ 5
Hi Jesse Koops, If you want to implement JQuery in your code then it is recommended to use the JQuery library otherwise the code wont execute. Paste this between your head tags if you want to use JQuery: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
4th Jan 2019, 6:05 PM
🌴Vincent Berger🌴
🌴Vincent Berger🌴 - avatar
+ 3
Your link isn't to an image so it is not recognized and therefore can't be displayed.
4th Jan 2019, 7:13 PM
John Wells
John Wells - avatar
+ 1
You need to insert the jquery library so you can use it. You can Google it there is ton of videos who explain this very well
4th Jan 2019, 7:29 PM
Nidhal Baccouri
Nidhal Baccouri - avatar
+ 1
John Wells thanks John!
4th Jan 2019, 7:57 PM
Jesse Koops
Jesse Koops - avatar
+ 1
Jesse Koops, Since you gave the submenu a display of none, you need to display it with jquery to show after click. $("#item").on("click",()=>{ $("#submenu").toggle(()=>{ $("#submenu").css({ display: "block" }); }); }); Hope this helps👍 Additional: https://www.w3schools.com/CSSref/pr_class_display.asp
4th Jan 2019, 8:36 PM
🌴Vincent Berger🌴
🌴Vincent Berger🌴 - avatar
+ 1
Jesse Koops, Excuse me! I totally forgot to smention that SoloLearn implements the javascript in the head tags. Therefore you need to get the DOM first before the JS can be executed. In this case the window.onload / document.onload is called when the DOM is ready. Have a look at the changes👍😊 https://code.sololearn.com/W3eG5IecB9Q7/?ref=app
5th Jan 2019, 3:39 AM
🌴Vincent Berger🌴
🌴Vincent Berger🌴 - avatar
0
🌴Vincent Berger🌴 Did that but it didnt work in my output. Do I also need to put the content from the link in my javascript page?
4th Jan 2019, 7:57 PM
Jesse Koops
Jesse Koops - avatar