HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

How To Alert In JavaScript With Yes / No

14,779 views October 26, 2019 2:09

Watch on YouTube
ChannelJunior Developer Central

Description 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

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.

Category
Education
Duration
2:09
Published
October 26, 2019
Views
14,779
Likes
93

Tags

Share

This tutorial in other languages