/How to create javascript confirm box yes no

How to create javascript confirm box yes no

Video: How to create javascript confirm box yes no

Subtitles

Hello Friends My name is sourabh dubey. And today I'm going to show you How to use confirmation box in JavaScript, so like they are my screen and I'll show you how to do this So here I'm using Visual Studio code and we have one alert for html5 right we're just writing our poll First just open html tab and I html tab close Right, so now we are going to just use here one button for open our confirmation box over we are using the button property and just close this button and now right here we are going to Click here Click, yeah, so in a button click we have to open our confirmation box. So we just to right here Okay So Right here We have script you have to right here function, right so our function I mean, maybe it's like Bob Confirmation walk so You have to follow a function from on click. So just about and that one we have we just call of action maybe write something like you have to create one variable there is Value so user value so user value and pull to confirmation confirm Confirm Bob and you have two paths here value.

Do you want to So you have to just click here you will say we can we get here to pattern first is okay and second one is canceled we have to store this result of your cancel me user well variable, so just we use the if condition if So if user double equal to true then our code will return us document.write . user want to continue Sending you right and if our User well is false when if the user just click on the pencil button? Then we got false value. So our message is document dot write User won't is at all So now we are going to run this program right here We have save update this file in my desktop So final image alert about your HTML and just open it and working and not we have to just check it out So that one is our button. So just click on here And do you want to continue if I am going to click on ok? So I got user want to continue the step as this pattern Page and just you want to continue. I'm just going to click on cancel button the user Don want to continue, right? So we just use here some properties in this ok and cancel button So I'm going to do document dot Document dot is style. Ok document or body dot style dot Background color right? So background color is if this either one to 2010 our particular something $0 it right if some user don't want to continue then we will show them what if color is So now let's see our Program again.

READ  Craftsman Smart Garage Door Opener with Wi-Fi Control

So click here if some user don't want to like you will be canceled so he will get or he will get the red body color, right? So if some user want to continue in our programs and You can okay and they will get green So it's only not about only color body color, you know You can do a lot of code here. You can use their functionality and you can use here What do you want to do in your food temple is it ok? So if I need out So can you comment and please like my video and subscribe my channel and thank you so much for watching the video. Thank you So much.