My brain flew out and I canβt figure out how to do this. Here is what I am trying to do:
HTML:
<div id=derp>"Hi, my name is.."</div>
JavaScript:
var div = document.getElementById('derp'); alert(div.innerHTML); alert(div.innerText); alert(div.textContent);
All of these warnings interpret and return " like " in the resulting string. I want the source text to be " uninterpreted.
They all come back:
"Hi, my name is.."
When I want to receive:
"Hi, my name is.."
Is there any way to do this? Preferably, not trying to use a regular expression to replace each instance of " with "
This is a long story of what I'm trying to do, but just using replace () to find and replace each instance " will be a headache to implement because of the different regex matching / parsing that should happen.
Thanks in advance for any Javascript wizard who can keep my judgment!
source share