jquery 事件需后加载,否则失效
<html> <head> <script type="text/javascript" src=".../jquery.js"> </head> <body> <table> <tr> <td id="Load">Button</td> </tr> </table> <script> //以下事件加载必须在 html加载完td Load 单元后再加载,否则会失效。 [color=blue]$("#Load").click(function(){ alert("hahaha"); });[/color] </script> </body> </html>
比如以下这么写,事件就无法加载。
<script>
$("#Load").click(function(){
alert("hahaha");
});
</script>
<table>
<tr>
<tdid="Load">Button</td>
</tr>
</table>
相关推荐
84483065 2020-09-11
85477104 2020-08-15
83510998 2020-08-08
tztzyzyz 2020-07-05
delmarks 2020-06-28
89510194 2020-06-27
牵手白首 2020-06-14
tztzyzyz 2020-05-31
81463166 2020-05-17
88570299 2020-05-17
delmarks 2020-05-17
donghongbz 2020-05-15
tztzyzyz 2020-05-15
<table id="table" class="table table-striped table-bordered table-hover table-nowrap" width="100%&qu
牵手白首 2020-05-14
Chriswang 2020-04-30
83510998 2020-05-03