+ 3
Little help
I see people using $("#id_value") instead of document.getElementById. What replaces the getElementById() method? Is it the $ sign or the #?
4 Respostas
+ 14
These JavaScripts are utilizing jQuery, a library that makes using JavaScript easier.
jQuery functions are accessed with the $ symbol. jQuery reads a name with a # symbol in front as an ID (like how you select IDs in CSS).
If you want to learn more about jQuery, we have a lesson on it you can try! https://www.sololearn.com/Course/jQuery/?ref=app
+ 8
Hey Emeruche Ikenna Cole
The shortened version is using jQuery
jQuery is a library for javascript, used to shorten down javascript and make it quicker to write code.
It is normally better to learn javaScript first, then move onto using the jquery library.
Here is the lesson on SoloLearn:
https://www.sololearn.com/Course/jQuery/?ref=app
Learn more:
https://www.w3schools.com/jquery/jquery_intro.asp
+ 2
The more closer one is document.querySelector("#id")
+ 1
$ is a shortened sign of jQuery. # is a id in HTML.