#11046 closed bug (wontfix)
.text() property strips whitespace on IE 8
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The following snippet: $('<h1><div>sub</div> title</h1>').text();
Correctly returns: "sub title" on Chrome, FireFox and IE9.
But on IE 8 it returns: "subtitle"
Change History (3)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Unlike the .html() method, .text() can be used in both XML and HTML documents. The result of the .text() method is a string containing the combined text of all matched elements. (Due to variations in the HTML parsers in different browsers, the text returned may vary in newlines and other white space.) Consider the following HTML
comment:3 Changed 11 years ago by
Just so you know it isn't jQuery doing the mangling:
IE8 and lower in particular likes to do strange things with whitespace.
Note: See
TracTickets for help on using
tickets.
jsFiddle example: http://jsfiddle.net/Qebq5/