jquery随意添加移除html的实现代码
2011-06-21 23:15
701 查看
function addRemoveItemNS() { var $newLi = $('<li class="special">special and new <button class="addone">I am new</button> <button class="removeme">remove me</button></li>'); $('#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(); });
相关文章推荐
- jquery随意添加移除html的实现代码
- jQuery 添加/移除CSS类实现代码
- jQuery 添加/移除CSS类实现代码
- jquery随意添加移除html
- jquery中插件实现自动添加用户的具体代码
- jQuery在某个标签的html代码后面,添加一些html代码?
- jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)
- jquery使用iframe实现HTML页面局部刷新代码
- jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)
- 用html、jquery、php编写新闻后台管理页面,动态添加新闻数据并实现数据的增删改查功能
- jQuery 实现左右两侧菜单添加、移除功能
- jquery中插件实现自动添加用户的具体代码
- jQuerydiv点击添加或者移除样式实现导航切换效果
- 使用jquery为table动态添加行的实现代码
- php+jquery+html实现点击不刷新加载更多的实例代码
- JQuery给select添加/删除节点的实现代码
- js操作html的table,包括添加行,添加列,删除行,删除列,合并单元格(未实现,可参考代码)
- Jquery实现的table最后一行添加样式的代码