事件冒泡

<html>

<body>

<table border="1" width="26%" id="tableA" onclick="alert('tableA')">
<tr onclick="tableA_rowA_click()">
   <td width="106">一般</td>
</tr>
<tr onclick="tableA_rowB_click()">
   <td width="106">阻止消息上传</td>
</tr>
</table>
<p>  </p>


</body>

</html>

<!--   -->
<script language="javascript">
<!--
function tableA_rowA_click(){
alert('tableA_rowA');
}

function tableA_rowB_click(){
alert('tableA_rowB');
event.cancelBubble=true;
}
//-->
</script> 

 

posted @ 2017-10-10 09:41  lilian'sblog  阅读(114)  评论(0编辑  收藏  举报