[Javascript] How to refer to an HTML element's ID attribute

BEKIM BACAJ trojani2000 at hotmail.com
Fri Nov 14 19:27:03 CST 2003


If NN 4.7 can handle TAG ID's take a look again,
you dont have to make the browser crawll all the way through all elements of 
the page just to get to this particular element,everytime you need it; 
...getelement... is IE syntax, event if it makes the broeser crowll only 
through elements with id atributte set, it again makes it inertial, refer to 
the element directly through DOM vars, it should be more compatible with all 
browsers and faster, - bye the way, of course you can never write the code 
that will be 100% compatible with all browsers, not even inside the same 
familly of browser versions, f.i. ie4, ie5, ie6, will never display or 
behave the same way with the same code 100%, sometimes les than 70%, but 
that's the curse of this art.


>From: Robert Pollard <rpollard at apple.com>
>Reply-To: "[JavaScript List]" <javascript at LaTech.edu>
>To: "[JavaScript List]" <javascript at LaTech.edu>
>Subject: Re: [Javascript] How to refer to an HTML element's ID attribute
>Date: Fri, 14 Nov 2003 09:00:48 -0800
>
>I apologize for being vague but I thought I would get a greater variety of 
>responses since I was looking for several different answers.
>
>What I needed was to get the value of an element by referring to its' ID 
>attribute.  What I wound up doing was using something like 
>document.getElementById("FeePercent").value.  I later found out this wasn't 
>compatible with all browsers (Netscape 4.7) that we are using.
>
>The question I have is what is the most compatible way of referring to the 
>HTML ID attribute?  Is there a way to refer to the element with the ID of 
>"FeePercent" in without using the DOM function?
>
>Thanks for everyones response.  They have been quite helpful.
>
>-- Robert Pollard
>
>On Thursday, November 13, 2003, at 03:59 PM, Robert Pollard wrote:
>
>>Hello all,
>>
>>What is the syntax to refer to an HTML element's ID attribute?
>>
>>Thanks,
>>
>>Robert Pollard
>>
>>_______________________________________________
>>Javascript mailing list
>>Javascript at LaTech.edu
>>https://lists.LaTech.edu/mailman/listinfo/javascript
>>
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* 
http://join.msn.com/?page=features/junkmail




More information about the Javascript mailing list