Learn JavaScript KEY EVENTS in 10+ minutes! ⌨

  Рет қаралды 15,863

Bro Code

Bro Code

6 ай бұрын

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

Пікірлер: 22
@BroCodez
@BroCodez 6 ай бұрын
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 6 ай бұрын
👽👽👽👽👽👽👽👽
@jakubmatusz1542
@jakubmatusz1542 6 ай бұрын
Could you paste HTML and CSS code also? :)
@iam_mausam
@iam_mausam 3 ай бұрын
@@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_- 2 ай бұрын
Bro can you do Kali Linux ?
@doronfeldman5152
@doronfeldman5152 6 ай бұрын
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 6 ай бұрын
best tutorials in a shorter amount of time, keep doing these man. expecting a playlist on new -v
@jiyoungkim9258
@jiyoungkim9258 6 ай бұрын
love watching this series
@Marsjemijntje
@Marsjemijntje 6 ай бұрын
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 6 ай бұрын
who the f makes a game with html
@Marsjemijntje
@Marsjemijntje 6 ай бұрын
@@Nihalthegreat Are you okay? For everyone's sake, I will leave it at that.....😘
@Nihalthegreat
@Nihalthegreat 6 ай бұрын
@@Marsjemijntjei didn't know about html game devlopment, sorry, i always did it with razium(c++) libary
@l-fitness3590
@l-fitness3590 4 ай бұрын
@@Nihalthegreatanyone like me whose new to coding
@MEIYANG-sj2sb
@MEIYANG-sj2sb 28 күн бұрын
thank you! you explained clearly and the example you showed was fun and relevant to the learning object
@jayac4400
@jayac4400 4 ай бұрын
Excellent teacher 😊 thank you for explaining very easily to understand
@widespectrumcreators4691
@widespectrumcreators4691 5 ай бұрын
Bro code= great tutorials with EPIC voice 😀😀😛👍👍🤩🤩
@snub7577
@snub7577 6 ай бұрын
you are a legend man
@H_canedit
@H_canedit Ай бұрын
👍👍
@user-yq7ip3jy3r
@user-yq7ip3jy3r 2 ай бұрын
Thank you !
@thaitrongson2249
@thaitrongson2249 6 ай бұрын
Thank you
@nihongo_
@nihongo_ 3 ай бұрын
WW
How to HIDE and SHOW HTML using JavaScript 🖼
5:11
Bro Code
Рет қаралды 9 М.
JavaScript Tutorial for Beginners: Learn JavaScript in 1 Hour
48:17
Programming with Mosh
Рет қаралды 12 МЛН
Why You Should Always Help Others ❤️
00:40
Alan Chikin Chow
Рет қаралды 136 МЛН
The day of the sea 🌊 🤣❤️ #demariki
00:22
Demariki
Рет қаралды 84 МЛН
ОДИН ДЕНЬ ИЗ ДЕТСТВА❤️ #shorts
00:59
BATEK_OFFICIAL
Рет қаралды 7 МЛН
Каха ограбил банк
01:00
К-Media
Рет қаралды 10 МЛН
How to FETCH data from an API using JavaScript ↩️
14:17
Bro Code
Рет қаралды 93 М.
How to ADD/CHANGE HTML using JavaScript 🛠️
15:33
Bro Code
Рет қаралды 9 М.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 456 М.
10 Tailwind Classes I Wish I Knew Earlier
13:31
Web Dev Simplified
Рет қаралды 166 М.
The JavaScript Survival Guide
14:47
Fireship
Рет қаралды 717 М.
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
Build JavaScript ROCK PAPER SCISSORS in 18 minutes! 👊
18:54
Learn JavaScript CALLBACKS in 7 minutes! 🤙
7:17
Bro Code
Рет қаралды 36 М.
Why You Should Always Help Others ❤️
00:40
Alan Chikin Chow
Рет қаралды 136 МЛН