日期:2014-05-16 浏览次数:20414 次
<div id="id1" style=" background-color:blue;"> id1<br /> <div id="id2" style="background-color:green;">div2</div> </div>
01.document.getElementById('id1').addEventListener('click', function() { console.log('id1');}, false); 02. 03.document.getElementById('id2').addEventListener('click', function() { console.log('id2');}, false);
01.document.getElementById('id1').addEventListener('click', function() { console.log('id1');}, false); 02. 03.document.getElementById('id2').addEventListener('click', function() { console.log('id2');}, true);
01.document.getElementById('id1').addEventListener('click', function() { console.log('id1');}, true); 02. 03.document.getElementById('id2').addEventListener('click', function() { console.log('id2');}, false);
01.document.getElementById('id1').addEventListener('click', function() { console.log('id1');}, true); 02. 03.document.getElementById('id2').addEventListener('click', function() { console.log('id2');}, true);