prova
If no argument is passed to the .index() method, the return value is an integer indicating the position of the first element within the jQuery object relative to its sibling elements.
Codice PHP:
<!DOCTYPE html>
<
html>
<
head>
  <
style>
div background:yellowmargin:5px; }
span color:red; }
</
style>
  <
script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
    <span>Click a div!</span>
<div>First div</div>
<div>Second div</div>
<div>Third div</div>
<script>
$("div").click(function () {
  // this is the dom element clicked
  var index = $("div").index(this);
  $("span").text("That was div index #" + index);
});
</script>
</body>
</html>