You want the li to have a class if it has child ul/li's ?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="nl">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<ul>
<li>One</li>
<li>Two
<ul>
<li>Two 1</li>
<li>Two 2</li>
</ul>
</li>
<li>Three</li>
<li>Four
<ul>
<li>Four 1</li>
<li>Four 2</li>
</ul>
</li>
</ul>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("ul li ul").parent().addClass("test");
});
</script>
</body>
</html> pritaeas
Posting Expert
Moderator
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875