Problem with style in getAttribute

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Libor
    New Member
    • Sep 2010
    • 1

    Problem with style in getAttribute

    Hallo, I have a problem with a part of code in my project. May I use exact part of a style attribute (for example width), like I´m trying in the example below? If it is possible, could you help me with it? The one I have written here doesn´t work. Thx

    document.getEle mentsByTagName( "div")[0].getAttribute(' style', 'width');
  • RamananKalirajan
    Contributor
    • Mar 2008
    • 608

    #2
    Try with this, it will work
    Code:
    document.getElementsByTagName("div")[0].style.width
    Thanks and Regards
    Ramanan Kalirajan

    Comment

    Working...