Reputation: 81
How to show alert box without "OK" button and close after 2 seconds
setTimeout(function() {
alert("$premium$");
}, 1);
Upvotes: 1
Views: 17599
Reputation: 729
You should create your own alertbox I think in vanilla CSS
Upvotes: 1
Reputation: 1503
You cannot hide buttons from native JavaScript dialogs. Your options depends on frameworks you are using. You can create custom dialogs with jQuery UI, Bootstrap and many other frameworks.
Upvotes: 0
Reputation: 337714
It's not possible to amend the dialog shown by the standard alert()
method as the buttons are controlled by the browser/OS.
If you need this behaviour you'll need to use a library which builds alert notifications in HTML which can be amended exactly as you require.
Upvotes: 5