Playback starts YouTube’s embedded player (privacy-enhanced mode).
How To Alert In JavaScript With Yes / No
ChannelJunior Developer CentralDescription from the creator
In this tutorial, you'll learn how to create an alert popup in JavaScript with Yes / No options.
🚀 Free JavaScript Essentials Course! 👉 codewithbubb.gumroad.com/l/ugyud
📖 Free 32-page eBook of JavaScript HowTos 👉 bit.ly/2ThXPL3
You may already know that you can create an alert box in JavaScript with the alert function but in this tutorial, you'll see how you can create an alert box with the confirm function that actually returns a true or false value, depending on which option the user clicks.
Unfortunately, you can't actually customise the text to be yes/no or any other combination, you would need to create a custom modal for that, but you can at least get an affirmative response from the user if you need to check for their consent before performing some kind of action.
See here for a video on creating your own custom modal popup with JavaScript: youtube.com/watch?v=KX0NR5HtQ1Q Channel Handle @codebubb
🚀 Free JavaScript Essentials Course! 👉 codewithbubb.gumroad.com/l/ugyud
📖 Free 32-page eBook of JavaScript HowTos 👉 bit.ly/2ThXPL3
You may already know that you can create an alert box in JavaScript with the alert function but in this tutorial, you'll see how you can create an alert box with the confirm function that actually returns a true or false value, depending on which option the user clicks.
Unfortunately, you can't actually customise the text to be yes/no or any other combination, you would need to create a custom modal for that, but you can at least get an affirmative response from the user if you need to check for their consent before performing some kind of action.
See here for a video on creating your own custom modal popup with JavaScript: youtube.com/watch?v=KX0NR5HtQ1Q Channel Handle @codebubb
About this tutorial
Junior Developer Central published this 2:09 video tutorial on October 26, 2019. It has been watched 14,779 times on YouTube.
- Channel
- Junior Developer Central
- Category
- Education
- Duration
- 2:09
- Published
- October 26, 2019
- Views
- 14,779
- Likes
- 93
Tags
Share
This tutorial in other languages
- FRComment alerte en JavaScript avec Oui / Non
- ESCómo alerta Para En JavaScript Con Sí / No
- PTComo Alerta Em JavaScript Com Sim / Não
- ITCome Alert In JavaScript con Yes / No
- DEWie zu alarmieren In JavaScript mit Ja / Nein
- NLHow To Alert In JavaScript Met Ja / Nee
- RUКак оповещения в JavaScript С Да / Нет
- PLJak Alert w JavaScript z Tak / Nie
- JAどのようにアラートでJavaScriptを使用してはい/いいえ
- ARكيفية تنبيه في جافا سكريبت مع نعم / لا
- HIकैसे हाँ के साथ करने के लिए चेतावनी में जावास्क्रिप्ट / नहीं
- IDCara Siaga Dalam JavaScript Dengan Ya / Tidak