#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Posts
    162
    Rep Power
    0

    Question 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
  2. #2
  3. No Profile Picture
    contains a pressurised widget
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    NC USA
    Posts
    401
    Rep Power
    12
    use name instead of id for this.

IMN logo majestic logo threadwatch logo seochat tools logo