Colour of Text in a Javascript Alert
Asked Answered
F

4

6

Is there any way to change style of text, format the text inside a Javascript Alert box. e.g. changing its colour, making it bold, etc.?

Also, if there an Alert avalaible with a 'Yes', 'No' button instead of an 'OK'/'Cancel' one?

Fermat answered 24/12, 2008 at 9:58 Comment(0)
C
25

No, I'm afraid that is not possible.

With JavaScript, you are limited to only 3 popup boxes: alert, prompt and confirm.

If you want to make a more featured popup, you should try using one of the many that exist written in JavaScript, which are built from JavaScript Libraries, such as this

Cutout answered 24/12, 2008 at 10:4 Comment(1)
Thanks! I guessed so, just wanted to confirm with the community, in case I had been ignorant. :)Fermat
F
3

The best you can do for formatting is the new line character \n.

Flautist answered 9/1, 2009 at 1:47 Comment(1)
It's not much, but it's something! Thanks.Trash
E
1

You can't manipulate the standard alert dialogs this way, but you can make your own ones and style them however you like.

Check out the custom dialog tutorial on slayeroffice.com for an example on how this can be done.

Eccentricity answered 24/12, 2008 at 11:5 Comment(0)
B
0

http://prototype-window.xilinus.com/ this is your man... runs on top of prototype and has AJAX, drag and drop and lots of thing ready waiting for you =)

Barm answered 30/12, 2008 at 2:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.