Closed Bug 253290 Opened 21 years ago Closed 21 years ago

display of anchor element DOM nodes displays the href attribute instead of the node description

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows 98
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: aceop, Unassigned)

References

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7) Gecko/20040616 Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7) Gecko/20040616 I've made experiments with the DOM in order to re-arrange parts of websites. I've tried walking through the DOM in a recursive way. Displaying a node with alert(node) normally produces output like "object text" or "objekt HTMLLiElement" or something. Only if you display an anchor node this way, you get the href attributes value instead. I find that's kind of strange and disturbing. Reproducible: Always Steps to Reproduce: 1. Load the testcase I'll attach with JS enabled and see. Actual Results: The alert displays "[object text]" for the text nodes, "http://www.mozilla.org" for the anchor element and "[object HTMLDivElement]" for the div element. Expected Results: It should have displayed "[objekt HTMLAnchorElement]" for the anchor element.
the testcase promised
Calling alert() on something just calls its toString() method and then alerts the string. Now anchor elements happen to have a nontrivial toString() method for DOM0 compat. So everything is working as expected.
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
*** Bug 361174 has been marked as a duplicate of this bug. ***
Component: DOM: Core → DOM: Core & HTML
QA Contact: ian → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: