Welcome back everybody.
All right so I'm just going to hide the CSSA here because we don't need that anymore.
And for the most part we're just going to be talking a little bit about HTML and javascript here because
remember e-mail sets up what it is visually and how the Web site works and Javascript will add in the
functionality meaning that Javascript can add something like a calculator or any kind of functionality
you'd normally see on your desktop was Ishmail just simply displays.
All right.
So you can see here if we run Messias.
Everything works good with pop et cetera.
Now we need to do is we need to add in a button here and this will show this will be able to call functions
which I'll describe here very shortly.
OK.
So I'm just going to type in button here and I'm going to type in the name.
This is a button just like this.
And I'm going to type in slash button just like that.
All right.
Now if we go ahead and click this button you can see that it has been rendered this in real time.
And if we click this button it does nothing and the reason is is that again we haven't told this button
to do anything and since we have told the button we haven't told the button to do anything.
It won't do anything.
However we run Rajai us the javascript file says Pop.
And that's what it'll do if I get rid of this.
Guess what it doesn't do anything because we have essentially there's nothing to justify.
So there's nothing for the computer run.
Now we need to do is need to add something onto this button.
And what it will do is it will call a function here and explain what the function is in just the second.
But if you just bear with me for a second and just type in on click K go equals to apostrophe's.
That's all we need to do here.
And what we're going to do is in these two apostrophe's we're going to call this my cool function.
OK.
And then we enter two brackets at the end of that.
So you can see that it says my call function.
And you also notice that the cool in function are capitalized while the my is not.
So usually the first word you don't capitalize yet the other where did you catheterize And the reason
is is that this doesn't look as good as this.
It's just the way your brain kind of filters out the information and it looks a little bit better like
this.
All right so now we have Michael function.
We need to hop over to the javascript and create a function.
So let's just go ahead and we'll type in function and we're going to go to my.
Cool.
We're just going to type in function just like that.
And of course you need the two brackets.
And then we need to curly brackets or push enter twice and there we go we've got two curly brackets.
Now again if we push this button it does nothing because there's nothing in the function to do.
So I'm just going to go ahead and type in alert and I'm going to type in pop just like that.
Pay just that.
And if we type this in just what it says Pop we can change the pop to awesome whatever you really want
to your name and it changes as well.
So what this is is that the button tells you tells the function to do something he calls a specific
function.
So if I were to take this in let's say a real world situation let's say you have a button and you have
a series of let's say 10 boxes.
Right.
And you push the button and a little robot grabs a certain box right box number one.
Well that's essentially what this is.
The button goes ahead and it calls a box of code for you to further computer run.
That's pretty much all all it is here and we can have one function we can have 10 functions we can have
100 functions we can have 100 buttons with 100 functions if you really want to all with different names.
And so that's essentially what a function is is the block of code that does something.
And that's pretty much all we need to know for this tutorial.
I'll see you guys next time.