Learn JavaScript MOUSE EVENTS in 10 minutes! 🖱

preview_player
Показать описание
#javascript #tutorial #course

// eventListener = Listen for specific events to create interactive web pages
// events: click, mouseover, mouseout
// .addEventListener(event, callback);
Рекомендации по теме
Комментарии
Автор

// eventListener = Listen for specific events to create interactive web pages
// events: click, mouseover, mouseout
// .addEventListener(event, callback);

const myBox =

myBox.addEventListener("click", event => {
= "tomato";
event.target.textContent = "OUCH! 🤕";
});

myBox.addEventListener("mouseover", event => {
= "yellow";
event.target.textContent = "Don't do it 😲";
});

myBox.addEventListener("mouseout", event => {
= "lightgreen";
event.target.textContent = "Click Me 😀";
});

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>

<div id="myBox">
Click Me 😀
</div>

<script src="index.js"></script>
</body>
</html>

#myBox{
background-color: lightgreen;
width: 300px;
height: 300px;
font-size: 4.1rem;
font-weight: bold;
display: flex;
align-items: center;
text-align: center;
}

BroCodez
Автор

Bro I majorly respect you and I feel like you're working so hard to keep posting content for us. I feel like you should just be free to take a break whenever you feel like it because I know the amount of hard work you put into these videos.

high.notes
Автор

I really like that you use "event" instead of "e" and function(event, callback) basic setup. Really helps understand. thank you!

js
Автор

I love how stark you are about the curly brackets. "click, event, do this."
It really is as simple as breaking it down into. For the lack of a better phrase, common tongue.

FlockofSmeagles
Автор

Bro my best teacher i've found. Am following all your tutorials (js and react) because of best explanations ever!

ralphrotichOfficial
Автор

Bro hard codes everything. Truly a chad💪

raulrahaman
Автор

thank you so much!! this helps a lot! my web development has improved significantly ever since i found your channel, and its only going to get better! i love the way you explain and show the code! kudos to you!!

leshanelim
Автор

Bro! Nice Lesson. Felt like i just finished a Class on mouse events! Thank you. <3

unvrsLcde
Автор

We would love your content. Thank you ❤ sir

tharunkumar
Автор

the only mentor that made me fall in love with code

MohamedMuhumed-du
Автор

Bro Code is the Best Code! Thank you for all that you do. You are a gentleman and a scholar.

nikolasknappen
Автор

Thank you, these videos have helped me learn JavaScript. Please would you let us know which VSCode extension you're using to pull up your Emoji console... I love what you're doing Thanks Again!

KennethCox-orbm
Автор

BroCode! lovin your videos!
Any plan to make Zig videos? Looks to be the hype especially since people realizes Bun is made with Zig.
cheers!

pietraderdetective
Автор

Bro sorry for my stupid question, but how can I add emojis on the HTML file just like you did at 1:00?

leFrederic
Автор

how do you toggle between the original state and a custom state?

liamlienhard
Автор

awesome video sir, i always learn something new from your video . btw i have a question sir

Whats the difference between using addeventlisterner and using .onclick, .onmouseover etc, its faster to use second option and easier too, event object also works on both methods, so which one should i use

TapasShrestha
Автор

Can you make course for making spigot plugins?

h
Автор

How to add emojis in HTML using VS CODE? Please share thar with us because it is easier than using HTML emojis by using tags

abdihamidmukhtar
Автор

Everyone's getting an heart can i too bro?

ahamednafees
Автор

btw, is the an easy way to make an undo button?

liamlienhard
visit shbcf.ru