selection.text(\' \') appears to convert the special characters so it renders the actual text, rather than a space like I want. Is there a way to prev
selection.text(\' \')
Use a JavaScript Unicode escape rather than an HTML entity. in HTML denotes the Unicode character U+00A0 so
selection.text('\u00A0')
should do what you want.