General
This code returns the position of a given element in a given container, relative to other elements of its type. Very useful for finding position indexes of list items, pictures, form items, and more.
Click on a list item below:
- This is an ordered list.
- Click on any item in the list.
- JavaScript can get its position!
- Very useful for dynamic lists.
Click on a graphic below (these are in a different container from the ones above):
Notes
- Created by: Daniel Burnett ("IceMetalPunk")
- Posted: May 9, 2008
Source Code
Paste this source code into the designated areas.
Head
Paste this code into the HEAD section of your HTML document.
Body
Paste this code into the BODY section of your HTML document
Do you write JavaScripts?
If you do, why not submit them to us?
We'll give you credit and a link back to your Web site.
