DUMB_CODER
DUMB_CODER

Reputation: 81

alert box without ok button in jQuery

How to show alert box without "OK" button and close after 2 seconds

setTimeout(function() { 
  alert("$premium$");
}, 1);

Upvotes: 1

Views: 17599

Answers (3)

Frontend employee
Frontend employee

Reputation: 729

You should create your own alertbox I think in vanilla CSS

Upvotes: 1

Vaidas
Vaidas

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

Rory McCrossan
Rory McCrossan

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

Related Questions