Alerts, Prompts and Confirm in Javascript
Kenechukwu Nwobodo
Posted on July 24, 2020
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,
β’ What is Prompt ?
Prompts enables the owner of the website to ask users/ visitors question(s) before they proceed to using the website.
Eg.
β’ What is confirm ?
Confirm looks like prompts in terms of the syntax but with the exception that it does not give an optional reply.
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!
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
July 16, 2022