$("#test")
represents this html object
$(".active")
represents all these html objects
$("#test").text("You put some new text in this element here");
"You put some new text in this element here"
inside the element with the id test
@SomeRandom42
<div id="test">
</div>
In the html panel
$("#test").text("You put some new text in this element here");
in the javascript panel
:cookie: 737 | @alpox |http://www.freecodecamp.com/alpox
var arr = [1,2,3,4]
You can access its first element by arr[0]
, second element with arr[1]
etc. until arr[arr.length-1]
for the last element.var arr = [1,2,3,4];
$("#test").text(arr[0]);
@SomeRandom42 When you have questions about javascript you'd better go over to HelpJavascript anyway :-) Now i can answer you though.
You have to distinguish JSON and Javascript.
JSON is a text representation of objects Means a special format used to transfer data. It allows to store data in a well readable textformat and even send it through the wire as this.
Javascript objects are datastructures of javascript to represent data. It can be converted to JSON and JSON back to javascript objects.
I know that FreeCodeCamp and its users really often don't properly distinguish that and use the term interchangable which is not appropriate and confuses people.
$
stands for a javascript function, its an abbreviation for jQuery
--> $ = jQuery
where jQuery is a javascript library which simplifies some tasks like interaction with the HTML DOM.
$(selector)
which selects html objects.jquery <task>
:warning: somerandom42 already gave alpox points
:cookie: 738 | @alpox |http://www.freecodecamp.com/alpox