I\'m trying to read the content of a contentEditable div and extract the currently active word. ie. the word which was just entered or one which was modified. <
String.fromCharCode(160) worked for me. It stands for character. if(str == ' ') was not working in if condition, neither did trim(); but if(str == String.fromCharCode(160)) worked.
For checking normal space use if(str.trim() == '')