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.
Assignee: rogerl → jst
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
Last Resolved: 17 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.