LuisPinto
LuisPinto

Reputation: 1687

Clear an alert message

Let's say I have a code like this:

alert('Hello World') 

So on my device is going to appear an alert message saying 'Hello World'. That message will be there until I press Ok.

But is there any way to remove the alert message from the screen with code? Instead of pressing Ok on the device?

Upvotes: 1

Views: 3739

Answers (2)

Fran Rios
Fran Rios

Reputation: 821

I had the same problem and this worked for me: https://github.com/CodeSeven/toastr

Upvotes: 0

jsdario
jsdario

Reputation: 6833

You can't.

Javascript close alert box

Not even in react-native. Best alternative would be to use custom dialogs or modals.

Upvotes: 2

Related Questions