Select n-th child : Selector children « jQuery « JavaScript DHTML
- JavaScript DHTML
- jQuery
- Selector children
Select n-th child
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("ul li:nth-child(2)").append("<span>*</span>");
});
</script>
</head>
<body>
<div>
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
</ul>
</div>
</body>
</html>
Related examples in the same category