reliable way to get element by name

A

Andrew Poulos

I'm working on updating some pages for a client that include Flash. The
pages have both OBJECT and EMBED tags. The ID for the OBJECT tag is
mirrored by the EMBED's tag NAME attribute.

quirksmode.org reckons that getElementsByName gives 'incorrect' results
for 4 of the 6 browsers that was tested. Is there a reliable way to
refer to the EMBED by its NAME?

Andrew Poulos
 
M

Martin Honnen

Andrew said:
I'm working on updating some pages for a client that include Flash. The
pages have both OBJECT and EMBED tags. The ID for the OBJECT tag is
mirrored by the EMBED's tag NAME attribute.

quirksmode.org reckons that getElementsByName gives 'incorrect' results
for 4 of the 6 browsers that was tested. Is there a reliable way to
refer to the EMBED by its NAME?

DOM Level 0
document.embeds['embedName']
should do better that getElementsByTagName.
 

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
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top