Is there a simple method  for determining the element number for a
click event?

Using this html code:

<P>Some Text</P>
<P>Some Text</P>
<P>Some Text</P>
<P>Some Text</P>
<P>Some Text</P>

Is there a click event that will tell you the element number of which
<P> was clicked on starting with 0 as the first one?

ie if you clicked on the first element it would tell you "element 0
clicked", if you clicked on the second element it would tell you
"element 1 clicked"

I figured out a way to do this by assigning an id to each <P> but I
was hoping there was a way to not need the id.

Thanks

Reply via email to