表格单元格增加hover事件

来源:互联网 发布:唯一网络怎么样 编辑:程序博客网 时间:2024/05/29 09:15
<!DOCTYPE HTML>
<html>


<head>
<meta charset=UTF-8 />


<script type="text/javascript" src="js/jquery-2.1.0.js"></script>
<script>
$(function() {


// $(document).on('mouseenter', '#msgTable001 tr .flag', function() {
// console.log("2222 : ");
// });
//
// $(document).on('mouseleave','#msgTable001 tr .flag',function(){   
//    console.log("4444 : ");
// }); 

$("#msgTable001 tr .flag").on('mouseenter', function() {
console.log("222233 : ");
});

$("#msgTable001 tr .flag").on('mouseleave',function(){   
   console.log("444455 : ");
}); 




});


</script>
</head>


<body>
<table id="msgTable001" border="1">
<tr>
<th>姓名</th>
<th>电话</th>
<th>电话</th>
</tr>
<tr>
<td>Bill Gates</td>
<td class="flag">555 77 854</td>
<td>555 77 855</td>
</tr>
</table>
</table>
</body>


</html>
原创粉丝点击