DOM is the tree of HTML elements created by the browser in order to show the html page
const element = document.querySelector('CSS_SELECTOR');
// element is now a Object of the DOM
const multipleElements = document.querySelectorAll('CSS_SELECTOR');
// multipleElements is now a nodeList of elements
element.insertAdjacentHTML('beforeend', '<tag>content</tag>'); // adds HTML to content
To start the exercises
- go in your code folder
cd ~/code
- go inside your github username folder with
cd your_github_username
git clone paste_here_ssh_link_to_your_assignment
- go inside the repo you've just cloned
cd js-DOM-events-your-github-username
(if
you presscd
+tab
it will be easier) - go inside the exercise folder
cd 01-select-element
- open VS_CODE
code .
- print values and messages to understand what the code is doing
cosole.log()
- run the programm
open the
index.html
file in your browser
Every time you complete an exercise remember to
git add .
git commit -m "exercise # done"
git push origin master
Good Hacking 🚀