Тёмный

The JavaScript checked property is easy ✅ 

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

00:00:00 intro
00:00:22 HTML checkbox
00:01:13 HTML radiobuttons
00:02:58 other HTML elements
00:03:55 CSS
00:04:39 JavaScript constants
00:06:08 .onclick property
00:06:31 .checked property
00:09:49 conclusion
// .checked = property that determines the checked state of an
// HTML checkbox or radio button element
const myCheckBox = document.getElementById("myCheckBox");
const visaBtn = document.getElementById("visaBtn");
const masterCardBtn = document.getElementById("masterCardBtn");
const payPalBtn = document.getElementById("payPalBtn");
const mySubmit = document.getElementById("mySubmit");
const subResult = document.getElementById("subResult");
const paymentResult = document.getElementById("paymentResult");
mySubmit.onclick = function(){
if(myCheckBox.checked){
subResult.textContent = `You are subscribed!`;
}
else{
subResult.textContent = `You are NOT subscribed!`;
}
if(visaBtn.checked){
paymentResult.textContent = `You are paying with Visa`;
}
else if(masterCardBtn.checked){
paymentResult.textContent = `You are paying with MasterCard`;
}
else if(payPalBtn.checked){
paymentResult.textContent = `You are paying with PayPal`;
}
else{
paymentResult.textContent = `You must select a payment type`;
}
}

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

 

4 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 17   
@BroCodez
@BroCodez 11 месяцев назад
// .checked = property that determines the checked state of an // HTML checkbox or radio button element const myCheckBox = document.getElementById("myCheckBox"); const visaBtn = document.getElementById("visaBtn"); const masterCardBtn = document.getElementById("masterCardBtn"); const payPalBtn = document.getElementById("payPalBtn"); const mySubmit = document.getElementById("mySubmit"); const subResult = document.getElementById("subResult"); const paymentResult = document.getElementById("paymentResult"); mySubmit.onclick = function(){ if(myCheckBox.checked){ subResult.textContent = `You are subscribed!`; } else{ subResult.textContent = `You are NOT subscribed!`; } if(visaBtn.checked){ paymentResult.textContent = `You are paying with Visa`; } else if(masterCardBtn.checked){ paymentResult.textContent = `You are paying with MasterCard`; } else if(payPalBtn.checked){ paymentResult.textContent = `You are paying with PayPal`; } else{ paymentResult.textContent = `You must select a payment type`; } } My website subscribe Visa MasterCard PayPal submit body{ font-family: Verdana; font-size: 2em; } #mySubmit{ font-size: 1em; }
@masternobody1896
@masternobody1896 9 месяцев назад
epic
@studyplant5715
@studyplant5715 8 месяцев назад
why we are write first in const the id onst myCheckBox = document.getElementById("myCheckBox"); const visaBtn = document.getElementById("visaBtn"); const masterCardBtn = document.getElementById("masterCardBtn"); const payPalBtn = document.getElementById("payPalBtn"); const mySubmit = document.getElementById("mySubmit"); const subResult = document.getElementById("subResult"); const paymentResult = document.getElementById("paymentResult"); that values ?? what is reason for write this @@masternobody1896
@SourovChandraBarmon
@SourovChandraBarmon 23 дня назад
Thanks a lot sir🥰
8 месяцев назад
Bro, this new JS series is just great because it is full of examples and mini project in which we can apply the knowledge to a real situation. Thanks a bunch!
@rajdeepchakraborty7961
@rajdeepchakraborty7961 28 дней назад
Exactly, the small handson are very useful for learning the difficult concepts
@rajushah8748
@rajushah8748 Месяц назад
You are a real Bro to us . We love you 😘
@helioobianchi
@helioobianchi 4 месяца назад
Thanks, bro. You're a real bro 💪
@spacejosh882
@spacejosh882 9 месяцев назад
Really cool tutorial, thanks!
@mrgames-Will
@mrgames-Will 9 месяцев назад
Thanks as always ❤
@piotrmazgaj
@piotrmazgaj День назад
This is my seal. I have watched the entire video, understood it, and I can explain it in my own words, thus I have gained knowledge. This is my seal.
@peschkeraphel
@peschkeraphel 9 месяцев назад
you're doing good videos I like it
@user-xu4bt2bq4g
@user-xu4bt2bq4g 2 месяца назад
You are the best
@MrPvssy
@MrPvssy 9 месяцев назад
Daddy Brocode teaches me lots
@gullapallijyothikiran3371
@gullapallijyothikiran3371 8 месяцев назад
do videos for the select dropdown .
@sayehghaderi9455
@sayehghaderi9455 2 месяца назад
This is exactly the way I can understand js.
@dinesh2076
@dinesh2076 6 месяцев назад
onlick😂😂🤣🤣
Далее
JavaScript TERNARY OPERATOR in 6 minutes!  ❓
6:46
Просмотров 16 тыс.
Редакция. News: 128-я неделя
57:38
Просмотров 1,5 млн
🤡Украли У ВСЕХ🤪
00:37
Просмотров 193 тыс.
If statements in JavaScript are easy 🤔
15:58
Просмотров 28 тыс.
Checkbox для заказчика. JavaScript
14:12
Просмотров 12 тыс.
The Heart of React || How React works under the hood
10:32
The New dialog HTML Element Changes Modals Forever
12:09
Build this JS calculator in 15 minutes! 🖩
15:20
Просмотров 456 тыс.
JavaScript CONSTANTS are easy 🚫
7:42
Просмотров 18 тыс.
Top 10 CSS One Liners That Will Blow Your Mind
13:34
Просмотров 933 тыс.
Learn CSS animations in 15 minutes! 🎬
15:19
Просмотров 57 тыс.
Редакция. News: 128-я неделя
57:38
Просмотров 1,5 млн