You can change the style of an Alert window [duplicated]

2

can you change the style of an alert () that is, some function to do it or it always has to be the same way?

    
asked by David Roberto 22.08.2017 в 17:44
source

2 answers

4

You can not. The alert window is native to the browser and the style can not be changed. You could create your own or perhaps download a plugin which can make your life easier.

You could use SweetAlert , it's very easy to learn and has nice design (although you can also give it your own style).

Here is another one called jQuery-confirm

Find the one that best suits your needs and tastes.

    
answered by 22.08.2017 / 17:56
source
0

As Comrade Hoose says, you can use SweetAlert . Very easy to implement and customize.

You add the necessary files and work.

<script src="dist/sweetalert.min.js"></script>
<link rel="stylesheet" type="text/css" href="dist/sweetalert.css">

And to work.

swal("Hello world!");

    
answered by 22.08.2017 в 18:06