473,762 Members | 8,598 Online
Bytes | Software Development & Data Engineering Community
+ 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.getElement ById("my_id");

Jun 23 '06 #1
1 1409
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.getElement ById("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
2511
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 component that gives me headache: <form name='task' ...> .... <select name='prioritySelect' class='selectwidth'>
11
3994
by: nntp | last post by:
Should I use both name and id <div name="abc" id="abc"> for using getElementById in NS?
2
1411
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, so this is just a snippet. If there are blank entries, the script is to change the appropriate images to warning icons. Unfortunately it aways errors at the getElementById with "undefined" as the reason. I know the names are right, so what's the...
3
5696
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 getElementById to select a particular form? -- Thanks, Justin. http://www.opera.com/mail/
12
4051
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 text inputs does not exist - the PHP doesn't generate the HTML for it. I wanted to have the validation script check the length of the input if it exists but I knew that I might have trouble if I tried to check the value of the input without first...
2
1180
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 2000 server at home and the added the .net framework. I can navigate for page to page with out any issue. When I click on a button to execute javascript:navigate I get and error ; Navigate.js is a script that executes "getelementbyid"
2
1643
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. (What I finally want is to set style.invisibility for the text in that DIV) TIA Jan
6
4202
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
12768
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. Content is "pushed" from the back via some JS, for the only displayed portion of table. Once the user scrolls, JS updates visible cells with data. It's quite the philosophy behind GMaps and similars. So, the server says to JS "update this group...
4
7484
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 = getElementById("ctl00_ContentPlaceHolder1_label"); x.Visible = true;
0
9554
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9378
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9989
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9927
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9812
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7360
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6640
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3510
muto222
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.