Get the index of an element contained into an array, according to the event object

Get the index of an element contained into an array, according to the event object

Hi, ive this code


  1. <div class="contStella" id="stellaquattro"><img class="stellaVota" src="immagini_sito/stella.png"/></div>



Javascript + Jquery


  1. var stelleArray=new Array ( $('#stellauno'), $('#stelladue'), $('#stellatre'), $('#stellaquattro'), $('#stellacinque') )
  2. $('#stellaquattro').mouseover(illuminastelle)
  3.    
  4. function illuminastelle(event
  5. {
  6.    alert(stelleArray.indexOf(event.target)) // <-this retrive me "-1" that means that the element hasn't been found in the array
  7. }


what's the solution? The event.target is "stellaquattro" right? and for what reason i can't found it into the array?
I tryied event.currenttarget too, without success