[SOLVED] find the row nuber clicked of the item list
Hello I'm just a starter and I'm looking for a function I can't find.
What I want:
I want the row number of the row i clicked of the item list.
For instance I click on third row then I want that var i returns 2.
My code:
-
<html>
<head>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("ls").click(function () {
var i = $( what must i type to get the clicked row number here??);
console.log(i);
});
});
</script>
</head>
<body>
<ul>
<ls>First <br></ls>
<ls>Second <br></ls>
<ls>Third <br></ls>
<ls>Forth <br></ls>
</ul>
</body>
</html>
Best Regards
Frank Pauw