Link to home
Start Free TrialLog in
Avatar of percyhoff
percyhoff

asked on

Javascript nested elements events

Hello all,

I have a <div> tag with a table nested in it. I want to perform a drag and drop funtion on the <div> based upon the div id property. The problem I am having is that when I use the event.getElementById and click inside the table nested in the div the ID property is an empty string because the table cell fires the event rather than the div tag. Any help will be greatly appreciated.
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of percyhoff
percyhoff

ASKER

Hello,

Thanks for the prompt reply. What do I need to do to let the event bubble to the parent element? Rather than being handled by the child. This is what I have right now that is returning the child element ID:  

objectID = event.srcElement.id;

Thanks