var cj="<a class='div_c'></a>";
$(".div_btn").each(function(){
$(this).click(function(){
//var a = $(this).createElement('a');
//a.setAttribute("class","div_c");
$(this).closest('div').append(cj);
$(this).remove();
})
})
$(".div_btn").each(function(){
$(this).click(function(){
//var a = $(this).createElement('a');
//a.setAttribute("class","div_c");
$(this).closest('div').append(cj);
$(this).remove();
})
})
还有就是在点击其他的".div_btn"的时候 已经创建了的".div_c" 也要还原回去请问下 应该怎么做啊
$(this).parents(".div").html('<a class="iv_c"></a>').siblings(".div").html('<a href="javascript:void(0)" class="div_btn">点击</a>');
})