您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

jquery随意添加移除html的实现代码_jquery

2024/4/4 12:30:15发布15次查看
html代码:
复制代码 代码如下:
plain
special i am special
plain
script代码:
复制代码 代码如下:
function addremoveitemns() {
var $newli = $('special and new i am new remove me');
$('#list3 li.special')
.find('button.addone')
.unbind('click.addit')
.bind('click.addit', function() {
$(this).parent().after($newli);
addremoveitemns();
})
.end()
.find('button.removeme')
.unbind('click.removeit')
.bind('click.removeit', function() {
$(this).parent().remove();
});
}
$(document).ready(function() {
addremoveitemns();
});
可以随意添加移除html代码。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product