Welcome back everyone.
All right.
So what I'm going to do actually is I'm just going to go ahead and delete this statement because we
don't really need it anymore.
And I'll just go ahead and you know everything works out good here.
I'll just move this over.
Now one thing that we can do is we can actually change the CSX or any style point within javascript
and is actually it's kind of cool.
So what it is is that technically you can do everything within the same HTML file if you really wanted
to you could add the script you can add in the style points etc..
So essentially if you wanted to change anything here you can do that.
The reason why CSSA and Javascript were invented.
And for the most part why they are in separate files is to make it look a lot easier.
OK.
So as you can see the C Ss remember it changes the style of it so it makes it.
So the short answer is that it makes it look different.
And what I'll do here is I've interchanged this paragraph text.
I'm going to change the color.
So how do we do that.
So again if we just simply run the program here you can see that it works out.
But what we need to do is we need to go ahead and we need to find this here.
Remember we need to find this tag.
OK.
And in order to do that we do document DOT gets elements by ID.
Simple enough.
And then of course which one are we getting we're getting para graph text.
K at this time though we're going to go Dot style because again there are styled in H.M. the restyled
Haig's and in CSSA we essentially take the style takes out so Daut style and then you type in whatever
you want so you can change the background color you know the color etc..
So let's just change the color.
It's pretty simple.
And we'll change it to maroon and maroon is the most under-rated color.
And there you go.
So if I go ahead and I change something so if I type in any kind of word here I can see that it changes.
Now you may or may not be able to see that.
So I'm going to change it to orange instead.
So we're going to change it to orange like that.
And there we go.
OK.
And you can see that the text changes to orange here.
Now one thing I should probably mention and I have mentioned this in my two male classes is that if
you type in a paragraph here for example and you say this is another para graph like this you can see
that they're both in the same color here because what the CSSA does is it changes the style tags for
everything right.
So if p here which is the paragraph tag we can change it to red and if I change this to you know maroon
like that you can see that they change to Marut.
But when we run this here so I type in the word fun right and you'll see that the top one changes to
orange.
But the bottom one doesn't.
And why is that is because this one has the ID paragraph tag.
Now if I go ahead and copy this paragraph tag and move it down here.
Watch what happens.
I change it to fun and you can see that here.
This one doesn't change just because it's already has an ID right.
It won't change because again it's already being referenced again.
And so for the most part that is how you change style tags with javascript.
I'll see you guys in next tutorial.