Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="div1"></div>
<div id="div2"></div>
</body>
</html>
 
document.addEventListener('DOMContentLoaded', function() {
        var div1 = document.getElementById('div1');
        var div2 = document.getElementById('div2');
        div1.addEventListener('mouseover', function() {
            setTimeout(function() {
                div2.style.display = 'block';
            }, 500);
        });
        div1.addEventListener('mouseleave', function() {
            setTimeout(function() {
                div2.style.display = 'none';
            }, 500);
        });
    });
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers