Are there any additional parameters besides the message accepted by the alert / confirm native JavaScript methods?
Specifically I would like to highligh开发者_运维百科t the cancel button rather than the ok.
If you need to do this, the way to get what you want is to concoct your own dialogs.
I'm not sure why any site design that takes itself seriously would ever use the built-in dialogs in the absence of some evidence that web users recognize some semantic content from those things (which I seriously doubt).
Oh, and the basic way to do this is to populate a <div>
with your dialog content; position it absolutely (or whatever, depending on your overall situation); and show it in front of a div that covers the whole page with partial opacity or something so that the dialog is "modal" (with respect to your own page). Various libraries provide ways to do that, some more fancy than others. The point is that since it's your own dialog, you can style anything you like.
精彩评论