By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,961 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,961 IT Pros & Developers. It's quick & easy.

html element question (getElementById)

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

Expand|Select|Wrap|Line Numbers
  1. b = document.getElementById('buttonName');
but when then i never get any results when i try to actually use b as an object, such as..

Expand|Select|Wrap|Line Numbers
  1. var x = b.offsetLeft;
Mar 8 '12 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 8,639
it works for me, maybe you invoke the call too early?
Mar 8 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.