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

推荐订阅源

WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Visual Studio Blog
宝玉的分享
宝玉的分享
IT之家
IT之家
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
I
InfoQ
B
Blog RSS Feed
T
Threatpost
博客园_首页
M
MIT News - Artificial intelligence
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Know Your Adversary
Know Your Adversary
U
Unit 42
Engineering at Meta
Engineering at Meta
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
Scott Helme
Scott Helme
T
Tor Project blog
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
S
Schneier on Security
Vercel News
Vercel News
博客园 - Franky
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
L
LangChain Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
Latest news
Latest news
C
CXSECURITY Database RSS Feed - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
S
Security Affairs
A
About on SuperTechFans
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
大猫的无限游戏
大猫的无限游戏
W
WeLiveSecurity
Cisco Talos Blog
Cisco Talos Blog
罗磊的独立博客

博客园 - .net小鸟

产品很重要 JQUERY FAQ 无法打开到主机的连接,在端口xxx连接失败 eclipse的调试技术 js parseInt与排序 html到asp.net样式变乱 django学习资料 FAQ js工具类 python31操作MySql jquery iframe 父子互操作 .net连接mysql maven下载地址 notepad++中用正则表达式 jquery 两个控件同享一个function javascript 经常会用到的东西 javascript template javascript closure anonymous function javafirststep
jquery操作ul
.net小鸟 · 2011-07-28 · via 博客园 - .net小鸟

View Code

<html>
<head>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script>
function exchangePosition()
{
    
//alert($("#list>li").size());
    //alert($("#list>li").length);
    //alert($("#li1").insertAfter($("#li2")));
    alert($("#li3").insertBefore($("#li2")))
    
//alert($("#li1").before().html());
    alert($("#li3").index());
    
var len = $("#ul>li").length;
    
    
    $(
"#list").children("li").eq(0).css("background-color","red");
    $(
"#list").children("li").eq(len-1).css("background-color","green");    
}

window.onload 

= function(){
    exchangePosition();
}
</script></head>
<body>
<ul id="list">
<li id="li1">11</li>
<li id="li2">22</li>
<li id="li3">33</li>
</ul>
</body>
</html>