Find out index of any element in Array using JQuery

Posted by Virendradugar under jQuery category on | Views : 19018
Below code will find index of element in the Array using JQuery. You can download the Jquery from .

<script type="text/javascript" src="Script/jquery-1.3.2.js"></script>

<script type="text/javascript">
var arr = [ "V", "I", "R", "E","N" ];
alert(jQuery.inArray("R", arr));

This will alert(2) as output.

inArray is a in-built function to check array element index.

Click below link to get mostly asked jQuery interview question.

Comments or Responses

Login to post response