0
WHY CAN'T I GET JQUERY!
What ever I do I cannot get JQUERY on sololearn please help I have so many great ideas that I know how to do but can't because I can't get JQUERY to work and I would learn the original JavaScript but it's hard to find anyone who will teach me when most online classes just use JQUERY can some one please help me
16 Respuestas
+ 10
SoloLearn compiles web codes by putting scripts in JS tab in <head>, so your $("button") is returning null because the button is not rendered yet.
Solution is to wrap your scripts in callback of window.onload
https://code.sololearn.com/W5AvK6tMvZn9/?ref=app
+ 8
https://www.sololearn.com/learn/jQuery/2785/
+ 8
please don't aim for badge, you cannot take virtual achievements out of this platform. I just downvoted your question with the goodwill to discourage you from falling into psychological traps of evil tech app.
for the position of script, let me explain a more fundamental concept :
there are different places to put JavaScript tags <script> in a <html>
for <script> in <head>, it will run before <body>
because <body> is not processed at that moment, so there is no elements such as <button> yet, so your get element methods will fail even for plain JavaScript.
+ 4
find a Try It Yourself and click it.
See the <script> in head?
+ 4
Show your code here
+ 3
Look at examples in the jquery tutorial.
+ 3
Learn before asking all these questions
https://www.sololearn.com/Course/jQuery/?ref=app
+ 2
https://www.sololearn.com/learn/jQuery/2785/?ref=app
You can learn from sololearn
+ 2
Or see my jQuery code which use much jQuery
https://code.sololearn.com/WPuy7TqQ8x66/?ref=app
+ 1
Gordon that doesn't help I've tried going to the JQUERY lesson and what it told me to do didn't work
+ 1
Gordon iv used JQUERY before and know how it works and how you have to put a script in the head with the src and the link and every thing and iv done it before but it's not working properly in sololearn
+ 1
Gordon got none of that but thanks for the help I'm done coding for the night because I don't know what time it is for you but it's 3am where I am I think what you said will make more sense to me in the morning... Or afternoon depends on how long I sleep p.s. would you mind giving my question a like I'm trying to get the bage
+ 1
Sorry about the bage thing thanks for the help again but I'm going to bed now I think I get what you mean and will take it into account while coding in the future p.s. I don't make online awards like that control my life I just think there fun