please dont rip this site

JScript / JavaScript Extension Feature

Returns a reference to the first object with the specified value of the ID attribute.

Syntax

oElement = document.getElementById(sIDValue)

Parameters

sIDValue Required. A String that specifies the value of an ID attribute.

Return Value

Returns the first object with the same ID attribute as the specified value.

Remarks

If the ID value belongs to a collection, the getElementById method returns the first object in the collection.

Example

This example uses the getElementById method to return the first occurrence of the ID attribute value, oDiv.

<SCRIPT>
function fnGetId(){
   // Returns the first DIV element in the collection.
   var oVDiv=document.getElementById("oDiv1");
}
</SCRIPT>
<DIV ID="oDiv1">Div #1</DIV>
<DIV ID="oDiv2">Div #2</DIV>
<DIV ID="oDiv3">Div #3</DIV>
<INPUT TYPE="button" VALUE="Get Names" onclick="fnGetId()">

Standards Information

This method is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 .

Include the following to ensure getElementById is available even in a browser without native getElementById but with document.all (such as MSIE 4):

if (document.all && !document.getElementById) {
  document.getElementById = function(id) {
    return document.all[id] } }

See also:


file: /Techref/inet/iis/jscript/htm/getElementById.htm, 2KB, , updated: 2009/7/28 14:12, local time: 2018/10/22 06:20,
TOP NEW HELP FIND: 
54.161.100.24:LOG IN

 ©2018 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE! / 

<A HREF="http://www.piclist.com/techref/inet/iis/jscript/htm/getElementById.htm"> getElementById</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

  PICList 2018 contributors:
o List host: MIT, Site host massmind.org, Top posters @20181022 RussellMc, Van Horn, David, Sean Breheny, David C Brown, Isaac M. Bavaresco, Neil, Bob Blick, John Gardner, Harold Hallikainen, AB Pearce - UKRI STFC,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
 

Welcome to www.piclist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .