On my page, I have a div and a button associated with it. If the button is hit, the div text becomes editable, but the current text in it is saved as a javascript variable. When the button is hit again, the original text is placed back into the div. However, if the div contained something like a & or a ', it gets placed back as something like $#39;. How would I check and solve this in my javascript code?
My idea is to check the string that will be returned for something like a &# since that seems to be the pattern they start with, but I'm not sure how to turn it to its proper symbol after that.