Alerts, Prompts and Confirm in Javascript

kene_nwobodo

Kenechukwu Nwobodo

Posted on July 24, 2020

Alerts, Prompts and Confirm in Javascript

They are quite some Javascript functions, I discovered that quite a few beginners may really in need of or might need a better understanding of the functionality and how they interact with the browsers.

Firstly, we will be looking into Alert. Hmmmm, not like credit alerts πŸ™‚, so you don't have to get your hopes up so high.πŸ˜„

β€’ What is alert ?
Basically alert makes use of a modal to display messages to the users (visitors of the website) in the browsers.

Let's take a look at the code below,
Javascript alert

β€’ What is Prompt ?
Prompts enables the owner of the website to ask users/ visitors question(s) before they proceed to using the website.
Eg.

Javascript Prompt

β€’ What is confirm ?
Confirm looks like prompts in terms of the syntax but with the exception that it does not give an optional reply.

Javascript confirm function

Disadvantages of making use of this Javascript interaction functions.

β€’ The browser displays it's where it wants it to be displayed. Mostly it's in the top center of the webpage.
β€’ You can't format like increase the width, add color to the modal etc.
β€’ You must opt out by clicking ok, cancel or ESC key before you continue using the webpage.

Aaya, this are all I can come up with for now, please kindly write under the comment section of they is anything you may wish to add to it or any corrections to the article. This would so mean mean alot to someone out there.

Thank you for reading!

πŸ’– πŸ’ͺ πŸ™… 🚩
kene_nwobodo
Kenechukwu Nwobodo

Posted on July 24, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related