Javascript - rename confirm() buttons

nicael picture nicael · Apr 5, 2014 · Viewed 73k times · Source

By default, there are two buttons:"ok" and "cancel" in confirm().
Is there a way to rename them?

Answer

guest picture guest · Apr 5, 2014

https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-confirm

According to the standard that defines confirm(), there is no way to specify custom button labels.

The browser must display a "positive or negative" prompt (e.g. OK/Cancel) to comply with HTML5.