How do I make the browser close automatically after the alert?
<html>
<head>
</head>
<body>
<div onmouseover="showText();" onmouseout="javascript:alert('my alert');" id="div"></div>
</body>
</html>
function alert(){
alert("my alert");
}
How do I make the browser close automatically after the alert?
<html>
<head>
</head>
<body>
<div onmouseover="showText();" onmouseout="javascript:alert('my alert');" id="div"></div>
</body>
</html>
function alert(){
alert("my alert");
}
Try to use:
window.close();
after the alert.
You could do something like this:
function alerta(){
alert('my msg');
}
function fechar(){
window.close();
}
#algo{
width: 100px;
height: 100px;
background: darkcyan;
}
<div id='algo' onmouseover='alerta()' onmouseout="fechar()"></div>