jquery 获取最后一个元素 及 after() before()和remove()元素替换

全文:http://www.w3school.com.cn/jquery/selector_last.asp

附:http://www.111cn.net/wy/jquery/64913.htm //after() before()和remove()元素替换

<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">

$(document).ready(function(){
$("#choose li:last").before("<li>123</li>");
});

</script>

</head>
<body>
<html>
<body>
<h1>Welcome to My Homepage</h1>
<p class="intro">My name is Donald</p>
<p>I live in Duckburg</p>
<p>My best friend is Mickey</p>
<div id="choose">
Who is your favourite:
<ul>
<li>Goofy</li>
<li>Mickey</li>
<li>Pluto</li>
</ul>
</div>
</body>
</html>


</body>
</html>

posted @ 2016-10-28 22:53  stma  阅读(1316)  评论(0)    收藏  举报