On Oct 20, 7:40 am, "jason maina" <[EMAIL PROTECTED]> wrote:
> [code]
> function monitorMgr(){
> var myLi=$$('ul.flMgr > li');
> myLi.each(function(liItem){
> Event.observe(liItem, 'click', anFunction, false);

`Event.observe`'s last argument - useCapture - is now deprecated (in
1.6), so you can safely omit it.

>
> });
> }
>
> function anFunction(evt){
> alert($(evt).id);}
>
> [/code]
>
> response: undefined
> expected result: the clicked li's id
> considerations: 2 ul elements sharing id because of css styling.
> This page is loaded in a div residing in another page 'parent page'.
>
> Which way out?

Event handler is being passed an *event* object, not an *element*. You
can access an element via `this` (since it's called within an element
context):

function handler(e) {
  this // <-- reference to an element that has this event handler
attached to
  e // <-- event object
}

> Regards
> -jason
>
> --
> Sent from Gmail for mobile | mobile.google.com

--
kangax
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to