473,473 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

getElementById() off a non-document node

can getElementById() be called off a non-document node.

on page load

temp = document.body;

document.body = set-to-blank...

var elem = temp.getElementById("my_id");

Jun 23 '06 #1
1 1382
ppcguy wrote:
can getElementById() be called off a non-document node.

on page load

temp = document.body;

document.body = set-to-blank...

var elem = temp.getElementById("my_id");


No, - getElementById - is a method of the document only. However, as an
ID is supposed to be unique to the entire document there is not
advantage in calling it on any given node in the tree anyway, except
maybe to determine that no element with that ID was a descendant of the
node on which it would have been called.

Richard.

Jun 23 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: drew | last post by:
Hi all! I have this annoying problem with netscape... I'm trying to access a form value by using getElementByID and in NS i end up with a null reference. The following HTML is the form...
11
by: nntp | last post by:
Should I use both name and id <div name="abc" id="abc"> for using getElementById in NS?
2
by: SC | last post by:
I'm having a problem getting this validation script to work. There are two images on the page with the ids of img_antirobot and img_chk_agree. In the final page it will validate about 12 entries,...
3
by: Justin Sane | last post by:
I haven't been able to select a form using getElementById. I only can select a form using the "name" property of the <form> tag. Is there another way to select a form, or is it even possible to use...
12
by: bcr07548 | last post by:
I am writing a web site that uses JavaScript to validate certain forms and I seem to be having some trouble. The site uses PHP and for one of the forms, depending on the situation, one of of the...
2
by: New guy.. please help | last post by:
"New guy.. please help" wrote: Hi, I'm a new kid onthe block.. I have a small company with a website that was developed in .net by a company for me. I want to work on it myself so I installed...
2
by: Jan Doggen | last post by:
Hello, The following code displays the name for all three elements in IE, but fails for the1st and 3rd in Firefox. What could be going on? I tried SPAN instead of DIV doesn;t work either....
6
by: Paolo | last post by:
I have a problem using the method getElementById: This is my code: dtd file: prova.dtd <!ELEMENT utente (nome, password)> hml file: prova.xml
4
by: Claudio Calboni | last post by:
Hello folks, I'm having some performance issues with the client-side part of my application. Basically, it renders a huge HTML table (about 20'000 cells in my testing scenario), without content....
4
by: Rob | last post by:
Hi, I have a label that I'm trying to make invisible on the client side using the OnClientClick event for a button. In the javascript function I have the following code: var x =...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.