0% found this document useful (0 votes)
72 views8 pages

DOM Manipulation

Basic of Javascript notes

Uploaded by

Srushti Rindhe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views8 pages

DOM Manipulation

Basic of Javascript notes

Uploaded by

Srushti Rindhe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

DOM

MANIPULATION
#1
Selecting Elements

getElementById: Select an element by its ID.

getElementById: Select an element by its ID.


#2
Modifying Text Content

This updates the text inside an element.

Change text:
#3
Modifying HTML Content

Use this to insert HTML inside an element.

Change HTML:
#4 Modifying Attributes
Set attribute:

Get attribute:
#5
Modifying Styles

Directly modify CSS properties of an element.

Change style:
Recap and Practice
Select elements: getElementById,
querySelector
Modify text: textContent
Modify HTML: innerHTML
Modify attributes: setAttribute,
getAttribute
Modify styles: style

Try these out in your projects!


Share Your Progress!

Comment below with your experiences


using DOM manipulation or any
questions you have.

Let's learn together!

You might also like