You do not need to index your items at all if you are describing. Due to the way jQuery combines its commands, any command you will run on all elements returned by the previous selector.
In the following example, all <a> elements will be hidden:
$(document).ready(function() { $("a").hide(); });
If this should be a specific element, you must provide it with a unique identifier:
$(document).ready(function() { $("#my-unique-id").hide(); });
If you want to return a specific index as a jQuery object, you must use the eq function .
$(document).ready(function() { $("a").eq(0).hide(); });
But then again, in your case, you don't need an index at all.
source share