I have a HTML file that has code similar to the following.
Hello World
I am using javascript like the following to get the value
document.getElementById(cell2.Element.id).innerText
This returns the text "Hello World" with only 1 space between hello and world. I MUST keep the same number of spaces, is there any way for that to be done?
I've tried using innerHTML, outerHTML and similar items, but I'm having no luck.
以上就是Javascript Removing Whitespace When It Shouldn't?的详细内容,更多请关注web前端其它相关文章!