Javascript DOM
Javascript DOM
Javascript DOM
JavaScript
DOM Manipulation
Mastering DOM Manipulation with JavaScript 🚀💡
Jimmy Ramani
@jimmyramani
2/8
Selecting Elements
document.documentElement :
document.head :
document.body :
p l e :
Ex am
Jimmy Ramani
@jimmyramani
3/8
document.querySelector :
Selects the first element that matches the given CSS selector.
p l e :
Ex am
document.querySelectorAll :
p l e :
Ex am
Jimmy Ramani
@jimmyramani
4/8
document.getElementById :
p l e :
Ex am
document.getElementsByTagName :
p l e :
Ex am
Jimmy Ramani
@jimmyramani
5/8
document..getElementsByClassName :
p l e :
Ex am
document..getElementsByName :
p l e :
Ex am
Jimmy Ramani
@jimmyramani
6/8
Jimmy Ramani
@jimmyramani
7/8
Deleting Elements
remove() :
parentElement.removeChild() :
we've added an event listener to the .btn element that removes the
message element when the button is clicked. You can also achieve the
same result using the parentElement.removeChild() method ...
Jimmy Ramani
@jimmyramani
8/8
just click on
https://codepen.io/jimmyramani
Go to
Js File
Uncommenting the code
last
Jimmy Ramani
@jimmyramani
WAS THIS
HELPFUL?
Share with a friend who needs it!
Jimmy Ramani
@jimmyramani