<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
</head>
<body>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
<script>$("ul li:nth-child(3)").append("<span> - Selected!</span>");</script>
</body>
</html>
私はli番号3を選択したいのです:nth-child(3)
が、問題は、liタグがランダムで、いつか6または9または20になる可能性があることです..最後を取得してから、おそらく prev() を使用するにはどうすればよいですか?