Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 864191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:26:09+00:00 2026-05-15T09:26:09+00:00

http://api.jquery.com/index/ Is there a way to use jQuery index() method to find the index

  • 0

http://api.jquery.com/index/

Is there a way to use jQuery index() method to find the index of an element related to the overall document?

I mean, if I have a bunch of img tags in a document, is there a way to know, regardless of their position in the document, their index?

example :

<body>
<img />
<div>
   <img />
   <div>
      <img />
   </div>
</div>
</body>

I’ve tried using $(window), $(body), $(document), but they all fail. I really need the overall index of the element.

Cheers!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T09:26:10+00:00Added an answer on May 15, 2026 at 9:26 am

    index() returns the position in a given collection:

    $('img').index('id');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://api.jquery.com/jQuery.unique/ lets you get only unique elements. Is there I can find out if
I am trying to use the focusout( http://api.jquery.com/focusout/ ) function in jQuery, to perform
According to http://api.jquery.com/category/selectors/ we can use a large amount of CSS selectors in jQuery,
Is there any equivalent in Prototype for the jQuery closest function? http://api.jquery.com/closest/ thanks
http://api.jquery.com/contents/ Supposedly, you are able to access an iframes DOM via the contents() method.
The jQuery docs at http://api.jquery.com/on/ mention the benefits of delegated-events using the following syntax
in this page http://api.jquery.com/category/effects/ when you put 'up'(keyboard) and 'down',then put 'enter',it will go
In Jquery Template website they gave this example.( http://api.jquery.com/jQuery.template/ ) <script> var movies =
Can someone tell me how to install this? I go here: http://api.jquery.com/browser/ and click
Here's an example taken from http://docs.jquery.com/API/1.1/AJAX#.24.post.28_url.2C_params.2C_callback_.29 $.ajax({ type: POST, url: some.php, data: name=John&location=Boston, success:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.