profxhtml,
Вариант
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div id="main">
<div class="holder">
<ul class="list" id="list">
<li>text text text</li>
<li>
text text text
<ul>
<li>text text text</li>
<li>text text text</li>
<li>text text text</li>
</ul>
</li>
<li>text text text</li>
<li>
text text text
<ul>
<li>text text text</li>
<li>text text text</li>
<li>text text text</li>
</ul>
</li>
<li>text text text</li>
</ul>
<ul class="list">
<li>text text text</li>
<li>text text text</li>
<li>
text text text
<ul>
<li>text text text</li>
<li>text text text</li>
<li>text text text</li>
</ul>
</li>
</ul>
</div>
</div>
<script>
document.getElementById("main").onclick = function (a) {
var a = a || window.event,
a = a.target || a.srcElement,
b = a.parentNode;
if (a.nodeName.toLowerCase() == "li" && b.nodeName.toLowerCase() == "ul") {
for (var c = 0, a = a.previousSibling; a && a != b;)
a.nodeName.toLowerCase() == "li" && c++, a = a.previousSibling;
alert(c)
}
};
</script>
</body>
</html>