Тёмный

Learn JavaScript KEY EVENTS in 10+ minutes! ⌨ 

Bro Code
Подписаться 1,9 млн
Просмотров 12 тыс.
50% 1

// eventListener = Listen for specific events to create interactive web pages
// events: keydown, keyup
// document.addEventListener(event, callback);

Опубликовано:

 

13 дек 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 22   
@BroCodez
@BroCodez 5 месяцев назад
FYI I was pretty sick while filming so my voice sounds kind of weird. // eventListener = Listen for specific events to create interactive web pages // events: keydown, keyup // document.addEventListener(event, callback); const myBox = document.getElementById("myBox"); const moveAmount = 10; let x = 0; let y = 0; document.addEventListener("keydown", event => { myBox.textContent = "😲"; myBox.style.backgroundColor = "tomato"; }); document.addEventListener("keyup", event => { myBox.textContent = "😀"; myBox.style.backgroundColor = "lightblue"; }); document.addEventListener("keydown", event => { if(event.key.startsWith("Arrow")){ event.preventDefault(); switch(event.key){ case "ArrowUp": y -= moveAmount; break; case "ArrowDown": y += moveAmount; break; case "ArrowLeft": x -= moveAmount; break; case "ArrowRight": x += moveAmount; break; } myBox.style.top = `${y}px`; myBox.style.left = `${x}px`; } });
@Vio.444
@Vio.444 5 месяцев назад
👽👽👽👽👽👽👽👽
@jakubmatusz1542
@jakubmatusz1542 4 месяца назад
Could you paste HTML and CSS code also? :)
@iam_mausam
@iam_mausam 2 месяца назад
@@jakubmatusz1542 Document body{ margin: 0; } #myBox{ background-color: lightblue; width: 200px; height: 200px; font-size: 7.5rem; display: flex; justify-content: center; align-items: center; position: relative; } 🐶
@-_SleepAndEat_-
@-_SleepAndEat_- 28 дней назад
Bro can you do Kali Linux ?
@doronfeldman5152
@doronfeldman5152 5 месяцев назад
You are the best programming channel. Only a month and a half ago I started learning on your channel and I have already made a site that checks answers and has 8 pages
@programmated_brian
@programmated_brian 4 месяца назад
best tutorials in a shorter amount of time, keep doing these man. expecting a playlist on new -v
@jiyoungkim9258
@jiyoungkim9258 5 месяцев назад
love watching this series
@jayac4400
@jayac4400 3 месяца назад
Excellent teacher 😊 thank you for explaining very easily to understand
@snub7577
@snub7577 5 месяцев назад
you are a legend man
@Marsjemijntje
@Marsjemijntje 5 месяцев назад
Oh my days, I was just wondering about some code for simple movement cause I am think of making a game.... and here you are! Thank you for all your videos they are super helpful and you always keep it fun!🍬
@Nihalthegreat
@Nihalthegreat 5 месяцев назад
who the f makes a game with html
@Marsjemijntje
@Marsjemijntje 5 месяцев назад
@@Nihalthegreat Are you okay? For everyone's sake, I will leave it at that.....😘
@Nihalthegreat
@Nihalthegreat 5 месяцев назад
@@Marsjemijntjei didn't know about html game devlopment, sorry, i always did it with razium(c++) libary
@l-fitness3590
@l-fitness3590 3 месяца назад
@@Nihalthegreatanyone like me whose new to coding
@widespectrumcreators4691
@widespectrumcreators4691 4 месяца назад
Bro code= great tutorials with EPIC voice 😀😀😛👍👍🤩🤩
@thaitrongson2249
@thaitrongson2249 5 месяцев назад
Thank you
@user-yq7ip3jy3r
@user-yq7ip3jy3r Месяц назад
Thank you !
@pluto6347
@pluto6347 4 месяца назад
why is arrow up y-= ? should it not be y+=?
@user-uh4xe8rd4h
@user-uh4xe8rd4h 4 месяца назад
Hi. In programming the zero point is the top left corner, so when you move up, the y gets nearer to 0 which means it decreases.
@nihongo_
@nihongo_ Месяц назад
WW
Далее
How to HIDE and SHOW HTML using JavaScript 🖼
5:11
JavaScript Pro Tips - Code This, NOT That
12:37
Просмотров 2,5 млн
나랑 동생이 버블티 마시는법
00:13
Просмотров 2,7 млн
Build this React To-Do List app in 20 minutes! ☝
22:35
Learn CSS in 1 hour 🎨
1:00:00
Просмотров 974 тыс.
Build this JS calculator in 15 minutes! 🖩
15:20
Просмотров 324 тыс.
Learn JavaScript Event Listeners In 18 Minutes
18:03
Просмотров 561 тыс.
Top 10 CSS One Liners That Will Blow Your Mind
13:34
Просмотров 881 тыс.
Using CSS custom properties like this is a waste
16:12
Просмотров 155 тыс.
addEventListener() - Beau teaches JavaScript
5:32
Просмотров 142 тыс.
Java KeyListener 🚀
13:11
Просмотров 93 тыс.