
March 9th, 2004, 07:48 PM
|
|
Contributing User
|
|
Join Date: Dec 2000
Posts: 163
Time spent in forums: 10 h 1 m 44 sec
Reputation Power: 0
|
|
To get the id of a CSSStyleDeclaration object
Hi, I hope somebody can help me.
I have a selected object
#imgC1 {position:absolute; left:500; top:200; width:200; border:solid black 1px;z-index:2}
var imgObj = window.event.srcElement (of type IMG)
var selectedObj = imgObj.parentElement.style (of type CSSStyleDeclaration)
Now when the image is clicked it can be dragged.
I want to get the id of the selectedObj (imgC1). I can get the text between the curly braces using selectedObj.cssText but I can't find a way to get the id. Any ideas?
Thanks in advance
Brian
|