|
Posted by allie on 11/02/06 12:55
I have a problem with inconsistency in IE browser, looking at the
innerHTML property and the actual contents.
I used this in a plain HTML page:
<div contenteditable="true" style="border:solid 1px black"
onblur="alert(this.innerHTML)">
</div>
If you type content with an extra linebreak, and press TAB to leave the
field, you see for example:
<p>a</p>
<p> </p>
<p>b</p>
Note that if you use the cursor to browse the DIV, you do NOT see
actually a space for the second line, there is in fact no space, it is
a empty line.
But if you place exactly this same content inside the editable DIV,
like this:
<div contenteditable="true" style="border:solid 1px black"
onblur="alert(this.innerHTML)">
<p>a</p>
<p> </p>
<p>b</p>
</div>
and then reload your page, then suddenly you DO see the space. How can
this be? How can the innerHTML property be different from the actual
contents ?
Please help me with this ...
Navigation:
[Reply to this message]
|