html element question (getElementById)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Manny Mo
    New Member
    • Mar 2012
    • 1

    html element question (getElementById)

    when i try to store a .getElementById (), i notice it never stores it properly. for instance i could have this code..

    Code:
    b = document.getElementById('buttonName');
    but when then i never get any results when i try to actually use b as an object, such as..

    Code:
    var x = b.offsetLeft;
    Last edited by Dormilich; Mar 8 '12, 03:55 AM. Reason: fixed code tags
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    it works for me, maybe you invoke the call too early?

    Comment

    Working...