1
00:00:00,180 --> 00:00:07,020
In this lesson we'll take a look at a basic example of DOM manipulation using JavaScript in the javascript

2
00:00:07,020 --> 00:00:11,220
portion of this course will cover many more methods.

3
00:00:11,290 --> 00:00:18,100
Here we have a basic HMO document inside the body tag.

4
00:00:18,220 --> 00:00:22,670
We have a javascript function named change text.

5
00:00:22,750 --> 00:00:28,300
This function will change any text contained within an element to the words new text

6
00:00:30,850 --> 00:00:37,020
outside of our script we have an h1 tag with an on click event attached to it.

7
00:00:39,180 --> 00:00:43,560
The on click event will execute the change TEXT function.

8
00:00:43,560 --> 00:00:53,850
This means that the text inside the H1 element click here will change to the words new text as defined

9
00:00:53,850 --> 00:00:55,690
in our function.

10
00:00:55,710 --> 00:01:04,650
Let's take a look at this in our web browser to confirm it works.

11
00:01:04,760 --> 00:01:10,430
You can see that when I click on the words click here it changes to new text.

12
00:01:10,900 --> 00:01:13,770
And so we've manipulated the Document Object Model.
