473,387 Members | 3,787 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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..

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
1 1124
Dormilich
8,658 Expert Mod 8TB
it works for me, maybe you invoke the call too early?
Mar 8 '12 #2

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

Similar topics

3
by: jonjon | last post by:
Hi, Is there any way of adding a property to an HTML element ? I heard about the "prototype" method but it doesn't work for HTML elements such as Images, or Paragraphs... Netscape implements...
1
by: q2005 | last post by:
Hi, all I have a very simple page and on the page there is a small javascript to create a html element. On one of my PC's runs no problem, the page is displayed and the created element is there....
2
by: Gary | last post by:
Hi, I am developing desktop application. In the desktop application am loading a html page, i want to acces html element value from C# code. Can anyone help me? how to access a html element or...
3
by: Halo | last post by:
I have a HTML text box (NOT a TextBox server control) in a .aspx page and a button server control. Is it possible with ASP.NET to get the value of the HTML text box when I click the button? How...
3
by: Jim Heavey | last post by:
If I have an HTML element, say a <p> tag with and ID="Fred", how do I find that element? I want to set the Style attribute to "hidden", how do I do that? Thanks!!!
2
by: petermichaux | last post by:
Hi, I'm trying to remove an html element in the example below. I don't see the "bye" message at the end and there are no errors reported in Firefox or exceptions caught if I wrap the remove...
1
by: oranmeir | last post by:
What i want actually is that when i right click on an element in my HTML file, select "properties" and then build the style of that html element, i want that the details about the position, colors...
0
by: matthewr | last post by:
Hi, I can append children to an HTML element in a WebBrowser control (.NET 2.0) using the appendChild method. However, how can I remove a child element? Thanks, Matthew
5
by: thisis | last post by:
Hi All, Hi All, (this is not the same topic as the my previous topic) What objects/methods/properties does VBScript offer for: Assuring/guarantee/make certain that ASP/VBSCript an ELEMENT...
7
by: Zhang Weiwu | last post by:
Dear all How does javascript realiablily tell if a variable is a reference to an HTML Element "<select>", without causing browser to pop up error message? if (variable.constructor ==...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.