Microsoft KB Archive/811037

= FIX: innerText Property Gives Incorrect Result with contentEditable Property =

Article ID: 811037

Article Last Modified on 11/5/2003

-

APPLIES TO


 * Microsoft Internet Explorer (Programming) 5.5 SP2

-



SYMPTOMS
If the contentEditable attribute of a PRE tag on element is set to TRUE, the innerText property does not behave as expected. If you insert line breaks in the text that is inside the PRE tag and then use the innerText property to retrieve the text, you notice that it does not include the line breaks. You may experience this behavior with Microsoft Internet Explorer 5.5 Service Pack 2 when you install the security updates that come with the Microsoft Knowledge Base article 313675, or with later cumulative updates.



RESOLUTION
To resolve this problem, install the following security update for Microsoft Internet Explorer 5.5 Service Pack 2.

../810847



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce the Behavior
  Paste the following code in Microsoft Notepad and then save it as Test.htm :   function showText { alert(&quot;!!&quot; + document.getElementById(&quot;div1&quot;).innerText+ &quot;!!&quot;); }     Press enter anywhere in this text and press the button.    </HTML> </li> <li>In Internet Explorer, locate Test.htm.</li> <li>Put the pointer in the middle of the text line and then press ENTER. The line breaks as expected. Click the button.</li></ol>

The result that you expect is for a message box to display the text as it appears in the browser with line breaks that break the text in two. However, after you install Internet Explorer 5.5 SP2 and patch Q313675, the message box displays the text in a single line without any line breaks.

Keywords: kbinetdev kbmshtml kbdhtml kbfix KB811037

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.