Wednesday, August 17, 2005

What's the difference between the value and innerHTML attribute in

This is the problem I just conquer in the Firefox.

For example, I have some space symbols in the textarea.
<TEXTAREA>&nbsp;&nbsp; abc</TEXTAREA>

1, <TEXTAREA onclick="this.innerHTML">&nbsp;&nbsp; abc</TEXTAREA>
I got "   abc".

2,
<TEXTAREA onclick="this.value">&nbsp;&nbsp; abc</TEXTAREA>
I got " abc".

No comments: