Is there a way to style the alert box in JS? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Is there a way to style the alert box in JS?

12th Jul 2022, 8:17 PM
Rae
2 Answers
+ 5
Hello! The dialog is a system object and cannot be styled. One of the ways to overcome this problem, is to create HTML element to mimic JS alert box. Here, it would also be a good idea to use jQuery UI dialogue that does a lot of the work! Link: "https://jqueryui.com/dialog/". Another solution would be to use the "https://sweetalert.js.org/"! It has quick-to-implement and great-looking solutions. Hope my answer was helpful, don't forget to vote for the answer to help as many people as possible ☺️
12th Jul 2022, 8:43 PM
Alix Paulino
Alix Paulino - avatar
0
try to use modals
14th Jul 2022, 12:11 AM
Ryann Kim Sesgundo
Ryann Kim Sesgundo - avatar