Javascript DOM Event Propagation

Description

Javascript DOM Event Propagation

View in separate window


<html>
<head></head>
<body onclick="console.log('body');">
    <div onclick="console.log('div 1');">
        <div onclick="console.log('div 2');">
            <div onclick="console.log('div 3');">
                I am inside a div.
            </div>
        </div>  
    </div>//from   w ww  . j  av a 2s  .  c  o m
</body>
</html>



PreviousNext

Related