jquery绑定失效了。。
<div id="tip1">
<span id="sp"></span>
</div>
<div id="tip2"></div>$(function(){
$("#sp").bind("click",function(){
})
})
这样是可以的。。
问题在于
document.getElementById("tip2").innerHTML=document.getElementById("tip1").innerHTML;
sp绑定就此失效,请问怎么办??
------解决方案--------------------
HTML code<div id="tip1"> <span class="sp">xxxx</span></div><div id="tip2"></div><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script>$(function(){ $(".sp").live("click",function(){ alert(111); }) $("#tip2").html($("#tip1").html())})</script>
查询谷 - www.chaxungu.com
jquery绑定失效了。解决思路
编辑:chaxungu时间:2022-10-02 23:16:09分类:web开发