复制代码 代码如下:
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代码。