# Help in Learning

**URL:** <https://forum.freecodecamp.org/t/help-in-learning/387692>\
**Category:** General\
**Created:** [May 12, 2020, 2:55pm UTC](https://forum.freecodecamp.org/t/help-in-learning/387692 "2020-05-12T14:55:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gurpreet\_Singh](https://avatars.discourse-cdn.com/v4/letter/g/b77776/32.png) [@Gurpreet\_Singh](https://forum.freecodecamp.org/u/Gurpreet_Singh)\
**Post date:** [May 12, 2020, 2:55pm UTC](https://forum.freecodecamp.org/t/help-in-learning/387692/1 "2020-05-12T14:55:53Z")

</div>

Hi everyone,  
Few days back i started learning javascript but when i see code there is lot things like (document.queryselector),(onclick) etc i havent learn this sort of things i learnt, class, object, function etc i need help what we call this part of javascript  
which has (document.queryselectorall) type of things and where i can learn them?  
help shall be highly appreciated.

---

<div class="post-metadata">

**Author:** ![Catalactics](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/catalactics/32/151364_2.png) [@Catalactics](https://forum.freecodecamp.org/u/Catalactics)\
**Post date:** [May 12, 2020, 3:13pm UTC](https://forum.freecodecamp.org/t/help-in-learning/387692/2 "2020-05-12T15:13:57Z")

</div>

What you learned was the basics of JavaScript. How to create variables, functions. What you saw is the DOM(Document Object Model) Manipulation for HTML. JavaScript was intended for use with HTML. That’s why it has all of these:

```auto
document.getElementById();
document.getElementsByClassName();
document.querySelector();
document.querySelectorAll();
document.body;
document.getElementByTagName();
//and much more

```

So what it essentially does is grab the HTML element using the selector above, and you can store it in a variable, or modify it.  
Here’s an example of how it works:  
HTML

```auto
<p id="change-me">Change Me</p>

```

This will display Change Me on the page. then this is where JavaScript comes in.

```auto
var paragraph = document.getElementById("change-me");
paragraph.innerHTML("Hello There, I changed the text");

```

Now, the text will be changed to `Hello There, I changed the text`.  
This is also where the library jQuery comes in, but don’t focus on that yet. Learn more about vanilla JavaScript First.

> [@Gurpreet\_Singh](#):
>
> (onclick)

This is an event listener. You can give an element an event listener, you can do this using the `.addEventListener(); ` function. Here’s how you do it.

```auto
<p id="just-a-paragraph">Click-Me</p>

```

JavaScript

```auto
var paragraph = document.getElementById("just-a-paragraph");
paragraph.addEventListener("click")

```

OR

```auto
var paragraph = document.getElementById("just-a-paragraph");
paragraph.onclick = function() {//codes here}

```

So when the paragraph is clicked, it will run the code. There are more event listeners in JS.

> [@Gurpreet\_Singh](#):
>
> where i can learn them?

As of learning it, I know FreeCodeCamp have a course for jQuery, but I don’t know if it has JavaScript DOM Api. I learned how to use the DOM Api on KhanAcademy. Here’s the link:

> [https://www.khanacademy.org/computing/computer-programming/html-css-js](https://www.khanacademy.org/computing/computer-programming/html-css-js)

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 1, 2021, 6:53pm UTC](https://forum.freecodecamp.org/t/help-in-learning/387692/3 "2021-06-01T18:53:56Z")

</div>

Closed on June 1, 2021, 6:53pm UTC


