sabu
sabu

Reputation: 2057

Change the styling of default alert box

Could someone please tell me how can I change the default css of a alert/prompt box ?

Upvotes: 0

Views: 12642

Answers (4)

Justin
Justin

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

Didier Ghys
Didier Ghys

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

Aaron Brewer
Aaron Brewer

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

Neil Knight
Neil Knight

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

Related Questions