Change Title of Javascript Alert [duplicate]
How can i change the title of javascript alert popup ?
Solution 1:
You can't, this is determined by the browser, for the user's safety and security. For example you can't make it say "Virus detected" with a message of "Would you like to quarantine it now?"...at least not as an alert()
.
There are plenty of JavaScript Modal Dialogs out there though, that are far more customizable than alert()
.
Solution 2:
As others have said, you can't do that either using alert()
or confirm()
.
You can, however, create an external HTML document containing your error message and an OK
button, set its <title>
element to whatever you want, then display it in a modal dialog box using showModalDialog().