OK, guys, welcome to the first video of the JavaScript in this video.
We will talk about the console, log on, click on, log onto alert and and Event Lessner.
The first thing first, what is the JavaScript like?
Say that I want I have here I put in and inside clent me
that JavaScript function.
When I click on this button, I want something to be happened.
That's why we are using the JavaScript.
It is very similar to the Darkhold when you visit the website and it utting that charge to choose between
the light and the dark one.
When we click on the dark you can see that everything will be changed to the dark.
This is for that JavaScript.
It's changing the classes of the divisions to be having the top ones.
OK, the first thing we will talk about in the comes along, we can go here and up the inspect from
here and click on console.
So it's empty right here.
We can go to this part to be put in.
The first thing we will talk about is how to create a JavaScript file.
We can just go here and typescript dot data and then side.
We will need to connect between them in order to use it inside our to email page.
We can go here and just typescript and here with that script, with a source and its closure.
And then inside we can type script dot G.S. and then we can go to the script and ask.
The first thing we will talk about is how to a console lot, which everything will be everything.
We will type here where it will appear here.
Look at first load.
OK, we can just type here, console, just love.
So I will not something inside the console, the console and the look here.
I will look the content with inside here to be here and then we can type our first console lock and
then we can go to the page and reload.
And here we have our first console log.
OK, that's good.
We can also try to add different, but we will need to add this syntax when we type on you could or
a new line or anywhere on your property.
We will be needing to add this sentence.
And here also we can type on another console
and this could be our second console, like we can go here and reload.
So here we got our first console log and our second console.
Look, let's say that I want the console to be enabled.
When I click on something, we can just go to the index attached to an L and here we can add put in
and we can give it a class of put on one.
And then inside here we can type something like console.
Good.
OK, that's good.
And then we can go back to the script J and add the same text here.
We can add something which is called function function and then we have a function again for the function
inside it.
I want to be having the console lock so the function will be containing the console up.
But before we add the console, we will be needing to add a name for this function.
We can give it the name, console or just function one.
And at the start we will be needing to add the parameters and we will leave it empty.
This means that the end of the name of the function and then inside we can type console dockland and
then here put in one was Klencke, OK?
And then we can go back to each team so we can tell the team, Alcaide, I want something here to be
having for this function.
We can add something here which is called unclick so unclick.
I want something to be happened which is the function.
What function do you want to be happen.
I want function one.
And the parameters.
OK, we have here everything good and we get into syntax here and safe and then we can go back to our
edge to find we can't hear that concept put.
When I click here now, we have put in one was clicked.
And also we have many things we can do for this part.
We can just go here and try something for the Adut.
There's something which is called Andat, which will appear here when I was a load the page.
We can go here after the function.
We can add some whitespace here.
OK, and then we can edit comment to add a comment.
And the JavaScript we can just use this flash and clozapine, this one function one.
OK, and at this part we can just scroll down and get in and let's get a comment and invite a comment
became type Alor one.
And here we can type alert and for the content of the Senate.
Yes, but let me just.
OK, we can make Enock and inside we can make welcome to our Web page and then we can go to our file
right here when we load.
We got welcome to our Web page.
And when I click on OK, now we got this dismissable.
But let's add the syntax.
Can I can I add it without a double quotation we can try to delete when we go back here, we got uncowed
error with the syntax for the line of thirty here.
It gets me the line and that error.
So when you give here, this is the syntax error for the job application and we got no error.
The second thing, can I make it just with syncopations?
We can go and try.
We can get the gist part and just single contentions.
We can go and reload so we can use them with double or single digits.
OK, that's good.
After this part, we can talk about the function for the other, we can go here and make here and edit.
The purpose of this code is to tell you that we can do many functions over many properties using the
same function name we can alad and then decide which one was clicked, can add syntax right here and
then we can go back.
What if I delete the changes we can do here?
It's working fine, but it will be always better to use the syntax because OK, but in was clipped,
but it will be always better to use syntax because many times might make a problem.
We can go here and try this text again and then after this part, let's go and reload.
Welcome to our page when I click on OK, and then when we click on Console Button, we got putting one
click and also we have the button.
One was clicked.
Let's try to make an addict without the thing function.
We can just make any function here function and give it the name of function to and then inside we can
make l'a and then to be header one
was click and then we can go to the URL file from here and here we can add X1 and then we can add unclick
to be having the function to and then side we can make a header one.
We can go back now to the edge html file and reload.
Welcome to our page.
Thank you.
And then when we click on the header one we got here, header one was clicked.
OK, that's good after activist part and we can talk about the ADD event left.
And how we can use it, let's say that I don't want to go back to the e-mail file to add the unclick
function, we can just go to this script and add something which is called add event left here.
The first thing we will think about is to add something.
What is called it would go OK.
The first thing we will know here is to how to select something from the HTML5 so we can just go here
and add to some content aside, like header through and then we can go back to the script, OK, which
is something which is called document.
What is document.
Document is this document right here, which is everything inside the page and then we can go back here.
The second thing we will add is Dot and then we will add something which is called query selector.
So now here I have a query.
What is the query?
I want to select something from the HTML five and then we end up in that bracket and beginning as double
quotation.
And then inside we got three options we can use.
Just here there are two and to add a class we can just add dot and then add the last name.
And we can also add I think we can make.
And then the IG me that he would just have to OK after his party.
We can add something for just add event left here.
So here I will be adding an event for this choir with a lecture and then sign the code red.
And you're can add some space.
The first thing we will type here is that be the first thing will be type inside here is the type of
event I want to happen.
That type of event would want to be happened.
It's the click we can just type here, click and then we have the click function and then we will add
a comment sorry, a comma.
And then inside we will type function with donita function name because we already had this click function
so we will not go to the team L and at this function name and then inside we can add some space here.
OK, we will add the same bracket as here at a bracket and then each side we will add the something
which we want to be happened.
We can go here and add some log of the header to what's the click the link to OK.
And then we can go to the estimate file.
OK, we can reload.
So here we got welcome to our page.
And then when we were a little bit page we got here had to click when I click on the header too and
when I click more I shouldn't be having this counted.
OK, that's great.
After this part, what we can just talk about is that the how to add another to using the same method.
We can just go here and the same text.
OK, and then inside of what we can do is to add other and then inside we can type header to was clicked
OK.
And then we can go back to the MLP.
And when we have here welcome to our Web page.
We can click on OK and then we can click on there are two.
So here we got Heather to was clicked and then at this part what we can do right here, I think that's
all we can just add the syntax.
OK, in the next video we will talk about how to change the content of the check.
Let's say that we have here and there, too.
And I want to change its content when I click on this one.
And we will also know how to use this is asked from the JavaScript and one click for an example, and
also we will know how to use it this function.
So good luck and have fun.