Reputation: 2057
Could someone please tell me how can I change the default css of a alert/prompt box ?
Upvotes: 0
Views: 12642
Reputation: 1299
The alert box that is used by javaScript is part of the browser. (other poeple have pointed this out but if you would like to have a good starting point try this.
http://jqueryui.com/demos/dialog/#default
jQuery Ui has some great tools for creating your own alert box and will also having other helpful options.
Just wanted to give some more information.
Upvotes: 2
Reputation: 30666
You can't. They are native to the browser and are not styl-able.
You should turn to javascript alert-like systems. Using jQuery, here are some:
This answer shows a way to have a confirm-like blocking dialog using jquery ui dialog
Upvotes: 5
Reputation: 3667
As noted above you may always use the jQuery Alert box...
But you may also fire a JavaScript/jQuery Function in which displays a DIV (HTML Element), in which you may style completely.
Upvotes: 2
Reputation: 48537
The alert
box is built into the Browser. You will need to popup your own dialog. The jQueryUI is very good for this.
For an example on this, look on the jQuery UI site.
Upvotes: 1