views:

286

answers:

4

Please help me.. tell me how to create and apply CSS to javascript Alert. i have got some other msgsbox also.. but as i have used alert every where so i just want to use CSS on it..

+8  A: 

You cannot. alert() simply shows a native message box, so it'll look like whatever it looks like on that OS.

In general, you shouldn't be using alert boxes because they are annoying and they block the entire browser (in most browsers). You could always create a fake alert box with JavaScript that achieves the same effect. You could then style it however you want with normal CSS. If you use jQuery, there's SimpleModal (demos).

musicfreak
+1  A: 

No you can't do that. I would suggest you either let it be, or use a modal window. You can also try using modal/dialog plugins e.g. http://docs.jquery.com/UI/Dialog

o.k.w
A: 

It is not possible, or else people will use it to phish.

SHiNKiROU
A: 

you might want to check jConfirm (jQuery plugin)

http://abeautifulsite.net/2008/12/jquery-alert-dialogs/

slier