0

I would like to override the alert() Javascript function, while preserving its "focusing" behavior. I.e., customize the aspect, while bringing the focus to the browser tab where the popup is opened.

gcedo
  • 4,811
  • 1
  • 21
  • 28

1 Answers1

2

It's not possible to directly customize/decorate the javascript alert box. What I would recommend doing is creating a custom alert modal, like the ones used by twitter bootstrap.

It's been asked in other stackoverflow questions (this one recommends jQuery UI's modal).

This alone won't bring the focus to the browser tab where the popup opened though. This answer provides a decent solution for that that works with firefox, using window.focus().

Community
  • 1
  • 1
johncorser
  • 9,262
  • 17
  • 57
  • 102