I’m trying to create a very simple contentEditable div input. However, any way that I can think of to get the value of the input is not exactly what the user typed in IE because whitespace is collapsed. i.e. “hello world” becomes “hello world”. But it’s important to me that I be able to get the text as the user has typed it if at all possible. Any ideas how I can do this?
I’m trying to create a very simple contentEditable div input. However, any way that
Share
It turns out that I can get the value just fine using innerHTML without IE collapsing any spaces. However, there is no way to set the value such that IE doesn’t collapse spaces, which makes it absolutely impossible to unit test.