Basics... addressing html elements in js

L

Lasse Reichstein Nielsen

Randy Webb said:
But, getElementsByName and getElementById are not "DOM based
addressing", they are part of the language itself.

What language? They are defined by the W3C DOM, but are not part of
the ECMAScript standard.
So are
document.anchors
document.applets
document.forms
document.images
document.links

Resist the urge to use the gEBI syntax when the browser already has a
collections for it. Meaning, don't fall for the "use gEBI unless I
can't" mentality. It will go a long way in your future to keep you out
of that mistake.

I'd say: Use collections when they are part of the DOM standard, and
fall back on (testing for) document.gEBI, document.all, etc otherwise
(in that order).


/L
 
L

Luke Matuszewski

So are (W3C DOM)
document.anchors
document.applets
document.forms
document.images
document.links
Yeap, so my thought were right about W3C DOM and listed above
elements...First browser that was precursor for W3C DOM Level 0 was NN
3+ and it was made for HTML standard(W3C DOM Level 0)...
I'd say: Use collections when they are part of the DOM standard
, and fall back on (testing for) document.gEBI, document.all, etc otherwise
(in that order).


PS1 on the other hand i will remeber to read ALL FAQs :(((
My problem is WELL DESCRIBED in
http://www.jibbering.com/faq/faq_notes/form_access.html on paragraph
"Radio Button and Other Control Collections"
I will remeber - first read faq then ask here.

PS2 This faq is really well written. Such kind of infos in one place
isn't in every book i had known.

Thanks for answer...
 
L

Lasse Reichstein Nielsen

Luke Matuszewski said:
First browser that was precursor for W3C DOM Level 0 was NN
3+ and it was made for HTML standard(W3C DOM Level 0)...

The W3C has no "DOM Level 0", only DOM Level 1 and 2. The de-facto
standards that have evolved around, and before, these are typically
called DOM Level 0, and include such things as the global "frames"
collection and "document" property, the "alert" and "setTimeout"
families of methods, and more.

(The first browser to include a collection was Netscape 2, with
"document.forms")

/L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top