steveo225
asked on
Accessing an objects parent object
I have an object, but need to get the handle for that object's parent, for example
<script>
function x(obj){
obj=obj.parent;
// do stuff to the parent object
}
</script>
<div><span onmousedown="x(this)">This is a span inside a div</span></div>
In that example, when the function "x" is executed it is passed the handle for the span, but I need the handle for the div that contains the span. Unfortunately what I have does not work, any ideas?
<script>
function x(obj){
obj=obj.parent;
// do stuff to the parent object
}
</script>
<div><span onmousedown="x(this)">This
In that example, when the function "x" is executed it is passed the handle for the span, but I need the handle for the div that contains the span. Unfortunately what I have does not work, any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot