Closed Bug 114380 Opened 23 years ago Closed 23 years ago

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

Categories

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

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: sinchi, Assigned: jst)

Details

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
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.
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
Closed: 23 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.