Properties .text of Link object and .innerText of any must contain ALT of image tags and VALUE of buttons.

RESOLVED INVALID

Status

()

Core
DOM: Core & HTML
RESOLVED INVALID
17 years ago
17 years ago

People

(Reporter: Manko, Assigned: jst)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
When i use .text or .innerText properties i expect to get any text information
from selected container, including ALT of images and VALUE of buttons.
Simple demo
<a href="page.html" onclick="alert(this.text);"><img src="myimg.png" alt="Sample
image" /></a>
must display alert window with "Sample Text" within.
dom0
Assignee: rogerl → jst
Component: Javascript Engine → DOM Level 0
QA Contact: pschwartau → amar
.text is working as designed (for Netscape 4 compatibility).

We seem to be returning the same thing for .innerText as for .text, which seems
odd.

Fabian?  :)
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 3

17 years ago
1) I don't think we don't support innertext
2) We coded (well I did so I must know :-) HTMLAnchorElement.text to match what
NS4 does, and last time I checked it returned text only when there was actually
a text node, not when there was an image.
We support .innerText fine... try it out.  :)

I can't find what interface it lives on, though...
Ok.. looks like I was having cache issues.  We do not in fact support
innerText...

I suggest marking this invalid, as .text is working as intended.
(Assignee)

Comment 6

17 years ago
INVALID, neither .innerText (if it was supported) nor .text should show non-text
content, alt text on images is not text content in the DOM. Not even IE behaves
this oddly.

INVALID.
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.