【www.gdgbn.com--jquery】
<script type="text/网页特效" src="jquery.js"></script>
<script type="text/javascript" >
$(document).ready(function(){
bindlistener();
});// 用来绑定事件(使用unbind避免重复绑定)
function bindlistener(){
$("a[name=rmlink]").unbind().click(function(){
$(this).parent().remove();
})
}
function addimg(){
$("#mdiv").append(" x ");// 为新元素节点添加事件侦听器
bindlistener();
}
</script>
代码二
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" >
$(document).ready(function(){
$("a[name=rmlink]").click(function(){
$(this).parent().remove();
})
})function addimg(){
$("#mdiv").append("x");
}
</script>
<script type="text/javascript" >
$(document).ready(function(){
bindlistener();
})function addimg(){
$("#mdiv").append("x");
// 为新元素节点添加事件侦听器
bindlistener();
}// 用来绑定事件(使用unbind避免重复绑定)
function bindlistener(){
$("a[name=rmlink]").unbind().click(function(){
$(this).parent().remove();
})
}
</script>