Nancy Nancy - 1 year ago 78
Javascript Question

How to display message for 3 seconds in javascript


Above code is displaying message but not going off screen. What could be the problem?

Answer Source

First display the message, then after 3 seconds delete it.

document.getElementById("alarmmsg").innerHTML = msg;

    document.getElementById("alarmmsg").innerHTML = '';
}, 3000);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download