mercredi 27 mai 2015

How to get key (index) value of a textbox in array textboxes

i want a jquery function or javascript that alert the index and the value of array textboxes : e.g.

<input type="text" name="textbox[]" value="1" onblur="javascriptfunction(this.value,this.index)" />
<input type="text" name="textbox[]" value="foo" onblur="javascriptfunction(this.value,this.index)" />

<input type="text" name="textbox[]" value="banana" onblur="javascriptfunction(this.value,this.index)" />

Whenever mouse moves for example from the first input i have this alerted (1,0) and second is (foo,1) and so on ! i couldnt find the function that does that please help !




Aucun commentaire:

Enregistrer un commentaire