Side navigation
#10913 closed bug (invalid)
Opened November 29, 2011 08:41AM UTC
Closed November 29, 2011 11:50AM UTC
jQuery.html() - removes double spaces on IE7 and IE8
Reported by: | Agnius101 | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | manipulation | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
1. Set html value with double spaces:
$("#list").html('<li>List item with double spaces.</li>');
2. Get html value:
$("#list").html();
3. html() function returns value without double spaces on IE7 and IE8, while it returns expected value on IE9, FF and Chrome.
See example on and check console output:
Attachments (0)
Change History (1)
Changed November 29, 2011 11:50AM UTC by comment:1
component: | unfiled → manipulation |
---|---|
priority: | undecided → low |
resolution: | → invalid |
status: | new → closed |
This is not a jQuery issue.
Using
alert( document.getElementById("list").innerHTML );
alerts the same thing on IE7/8You could of course use
<pre>
or CSSwhite-space: pre
to keep the whitespace. You could also replace the whitespace with the whitespace entitity