首页 > Web开发 > 详细

jquery on event

时间:2017-02-28 17:52:40      阅读:158      评论:0      收藏:0      [点我收藏+]
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>on demo</title>
  <style>
  p {
    background: yellow;
    font-weight: bold;
    cursor: pointer;
    padding: 5px;
  }
  p.over {
    background: #ccc;
  }
  span {
    color: red;
  }
  </style>
  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
  
</head>
<body>
 
<p>Click me!</p>
<span></span>
 


 
<table id="table1">
    <tr id="tr1">
    <td>  c 1 </td>
    </tr>
    
    <tr id="tr2">
    <td> c 2 </td>
    </tr>
    
</table>
 
 <table id="table2">
    <tr id="tr1">
    <td>  table 2c 1 </td>
    </tr>
    
    <tr id="tr2">
    <td> table 2c 2 </td>
    </tr>y.fei
    
</table>
 
 
 <script>
  
 var count = 0;
$( "#table2 #tr1 td" ).on( "click", function() {
  $( this ).after( "<p>Another paragraph! " + (++count) + "</p>" );
});

</script>
 
</body>
</html>

 

jquery on event

原文:http://www.cnblogs.com/rojas/p/6479608.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!