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

Chris Tifer christ at saeweb.com
Fri Nov 14 14:19:03 CST 2003


My intent is to get people away from having people to write functions that
are based off of browser types. The more developers adopt this, the more
browser makes will enforce standards. If we don't give them reason to, then
some of them never will make it easier on us.

To me, I don't care if they're on a 28.8 - Upgrade or just get rid of your
computer...

----- Original Message ----- 
From: "Peter Brunone" <peter at brunone.com>
To: "'[JavaScript List]'" <javascript at LaTech.edu>
Sent: Friday, November 14, 2003 2:26 PM
Subject: RE: [Javascript] How to refer to an HTML element's ID attribute


>
> Oh... I was just telling him what would work instead of
> recommending that he give his users the finger :)
>
> It's very easy to write a getElement() function that takes into
> account every browser from 4 to the present.  Much easier, in fact, than
> getting Joe Modem to download a new browser program at 28.8kbps.
>
> -----Original Message-----
> From: [mailto:javascript-bounces at LaTech.edu] On Behalf Of Chris Tifer
>
> That's a possibility - if you'd rather use deprecated code to make old
> browsers work, but I'd prefer to go the newer route.
>
> ----- Original Message ----- 
> From: "Peter Brunone" <peter at brunone.com>
>
> > Actually, in my example at
> > http://authors.aspalliance.com/peterbrunone/pleasewait.asp , I refer
> > to a DIV with only an ID using document.divID.
> >
> > -----Original Message-----
> > From: [mailto:javascript-bounces at LaTech.edu] On Behalf Of Chris Tifer
> >
> > I don't believe you're going to have luck with accessing attributes in
>
> > NN4.7 either.  I may be wrong though. My suggestion... Tell NN4.7
> > users to upgrade. They're quickly going by the wayside now anyway.
> >
> > ----- Original Message -----
> > From: "Robert Pollard" <rpollard at apple.com>
> >
> > > 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




More information about the Javascript mailing list