Hello, in this JavaScript video, I am going to show you events. So we're going to do some really basic HTML here. And I'm just going to write the JavaScript code here as well. Okay? So what we're gonna do is do event event is when something happened, like you click Buy time, you move the mouse, he enters a particular location or like an element on the screen. That is an event that had been triggered.
As a result, you could do something, I'm just going to show you the on click event. The principle is the same for all the other events. I will provide a link that shows you all of the different events that JavaScript provides. I think I've said the word event a million times in the last 10 seconds a lot. I will stop saying that word for now, though, to implement a concept called you know, I need to say, Did you implement an event pretty simple, you just need to add a attribute to a no any element. So we just do on click.
So this is You know, for the click one, but there are other ones like this on Mac stem Sublime is pretty good like this, and it shows you the different ones when you start typing equals. And in here, we actually specify a method that gets called, which is written in our JavaScript. Yes, I'm gonna say, cool. Awesome. So there we go. Copy that.
And here, we just create our function the way we normally would. We could pass in some parameters if we wanted to, but we're going to keep it simple. We're going to console dot log. Hello. If I reload it, obviously nothing happens. I click it, it says hello.
And you know every time I click it, it you know does a new one. And that's it for events. You know, commonly you would have events like on click on more conventional clickable items, like a button and not just some title, but the principle is exactly the same. You just see an attribute assigned to an element has some sort of function name function goes, Yeah, put some code in between it any sort of code against any type function. And that's it like that. I'll provide a link so you can see all of the other different events that you can tap into.
If you have any questions, feel free to drop me a message and I look forward to seeing you in the next video.