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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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