GetPosition 2 | JavaScriptSource

GetPosition 2

Daniel Burnett May 9, 2008

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:

  1. This is an ordered list.
  2. Click on any item in the list.
  3. JavaScript can get its position!
  4. 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


Leave a Response

(1 comment)

Nice Code...saved my time :)

Vishwa May 14, 2008