How do I get a event's target element

Asked by Johan Axelsson

In Internet explorer I can get a events target element by calling event->get_srcElement but it doesn't work in Firefox , the event->get_target returns a EventTarget not a Element.

Regards Johan

Question information

Language:
English Edit question
Status:
Solved
For:
Cheerp Edit question
Assignee:
No assignee Edit question
Solved by:
Alessandro Pignotti
Solved:
Last query:
Last reply:
Revision history for this message
Best Alessandro Pignotti (a-pignotti) said :
#1

EventTarget is a base class for the Node class which is itself the base class for Element. You can get the corresponding Element object by doing:

client::Element* element=(client::Element*)event->get_target();

If you want to see the API documentation of the C++ browser interface you can a look here

http://leaningtech.com/API/

Revision history for this message
Johan Axelsson (johan-axelsson) said :
#2

Thanks Alessandro,
Works perfect.

Regards Johan