Search code examples
javascriptdialogalertconfirm

How to customize the Javascript Dialogue options?


I am working on an e-commerce website, I want to display a Javascript dialogue box with two options "Go to Cart" & "Continue Shopping", If user clicks on first option control will redirect to Cart page and if user chooses second one it will go to Home page.

I have an option of using javascript's Confirm() function but I can not change its options to "Add to cart" and "Continue Shopping"

How can I display such a dialog?


Solution

  • You can not customize confirm dialogue box, but there are several libraries for alerts,

    Following are some well known libraries for such purpose

    • Bootbox
    • AmaranJS
    • Notie.js
    • Sweet Alert
    • Alertify.js