惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
N
News and Events Feed by Topic
P
Privacy International News Feed
The Hacker News
The Hacker News
Schneier on Security
Schneier on Security
C
Cybersecurity and Infrastructure Security Agency CISA
Security Latest
Security Latest
L
LINUX DO - 最新话题
阮一峰的网络日志
阮一峰的网络日志
Cisco Talos Blog
Cisco Talos Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
博客园 - 【当耐特】
博客园 - Franky
P
Privacy & Cybersecurity Law Blog
Attack and Defense Labs
Attack and Defense Labs
云风的 BLOG
云风的 BLOG
月光博客
月光博客
D
Docker
Webroot Blog
Webroot Blog
The GitHub Blog
The GitHub Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
W
WeLiveSecurity
S
Security Affairs
Martin Fowler
Martin Fowler
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Security Archives - TechRepublic
Security Archives - TechRepublic
Microsoft Azure Blog
Microsoft Azure Blog
C
CERT Recently Published Vulnerability Notes
B
Blog
L
Lohrmann on Cybersecurity
T
Threatpost
量子位
S
Schneier on Security
V
Visual Studio Blog
S
Securelist
T
The Exploit Database - CXSecurity.com
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
aimingoo的专栏
aimingoo的专栏
The Register - Security
The Register - Security
I
Intezer
Stack Overflow Blog
Stack Overflow Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 聂微东
小众软件
小众软件
罗磊的独立博客
雷峰网
雷峰网
Recorded Future
Recorded Future

博客园 - 那时花开

VS2012 快捷键 VS Resharper 设置 TFS2012 独占签出实现 WinForm 生产环境、测试环境 多配置-App.config(分享) TFS2010 服务器名称变更bug 怎样和客户一起搞定需求 MSMQ XP 0x433 430 错误处理 页面关闭时弹出广告 ajax 同步异步模式问题 asp.net membership 配置错误 Test Concurrent 本地安全策略 脚本 在asp.net 3.5中sql 2005数据库缓存依赖 关于 p3p ie 跨域 问题 jquery 常用方法整理 存储过程生成代码 sql2000版 It 人大多路线图 收集常用数据库设计技巧 PowerDesigner 常用设置 mssql 数据库文档生成
jQuery插入,复制、替换和删除节点
那时花开 · 2009-12-29 · via 博客园 - 那时花开

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <title>jQuery插入,复制、替换和删除节点</title>
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
   $(document).ready(function(){
     //几种添加节点的方法
    //$("p").append("<b>你好吗?</b>");//向p元素中追加《b》
    //$("<b>你好吗?</b>").appendTo("p");//将《b》追加到p元素中
    //$("p").prepend("<b>你好吗?</b>");//向p中前置《b》
    //$("<b>你好吗?</b>").prependTo("p");//将《b》前置到p元素中
    //$("p").after("<b>你好吗?</b>");//向p元素后插入《b》
    //$("<b>你好吗?</b>").insertAfter("p");//将《b》插入到p元素后边
    //$("p").before("<b>你好吗?</b>");//在p元素之前添加《b》
    //$("<b>你好吗?</b>").insertBefore("p");//将《b》插入到p元素前面
  
  
    //几种删除节点的方法
    //var $li=$("ul li:eq(1)").remove();//删除ul节点中第2个元素节点
    //$("ul").append($li);//把刚删除的元素节点从新添加到ul元素中去
    //$("ul li").remove("li[title!=菠萝]");//将ul元素下title属性不等于"菠萝"的li元素删除
    //$("ul li:eq(1)").empty();//清空ul节点下第2个li元素的内容
  
    //复制节点
   /* $("ul li").click(function(){
     $(this).clone(true).appendTo("ul");//复制当前点击的节点,并将它追加到《ul》元素中,当添加参数时复制它的事件
  
    });
    */
    //替换节点
   //$("p").replaceWith("<strong>你最不喜欢的水果是?</Strong>");
   $("[name='rp']").replaceWith("<tr><td>gg</td><td>gg</td><td>gg</td><td>gg</td></tr><tr><td>gg</td><td>gg</td><td>gg</td><td>gg</td></tr>");
  
   });
</script>
</head>
<body>
   <p>你好!</p>
   你最喜欢的水果是?
   <ul>
    <li title="苹果">苹果</li>
    <li title="橘子">橘子</li>
    <li title="菠萝">菠萝</li>
    </ul>
</body>
</html>

用心对待身边的一切,一切皆有可能!