can you change the style of an alert () that is, some function to do it or it always has to be the same way?
can you change the style of an alert () that is, some function to do it or it always has to be the same way?
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.
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!");