1 – DOM – Methods :
Write into you html page.
Then you can :
1 – Write your script in your html page :
See the green part commented in the html file above.
2 – Write your script in a distinct javascript file.:
Then in your rendered html page you’ll be able to print your text “Hello World !”.
2 – DOM – Document :
a) Finding Elements :
b) Changing Elements :
c) Adding or deleting Elements :
d) Finding Html objects :
e) Adding Events Handlers :
3 – DOM – Elements :
To manipulate Html pages we have to find elements at first. We can do with 5 possibilities :
- a) elements by id.
- b) elements by tag name
- c) elements by class name
- d) elements by CSS selectors
- e) elements by Html object collections