I am building a website that teaches people how to code a website. I am trying to add a feature where they code the exercise into a text box and I then compare that to a string to see if they got it right or not yet. I am running into an issue though when there is quotes inside the strings answer because that then ends the string thus cutting off some of the answer. How can I get around this?
All feedback is greatly appreciated!
Here is an example of a strings answer that screws it up:
var answer = "var greeting="Hello World!"; ";
The second pair of quotes end the string's declaration early. Is there a way to include all of it including the second pair of quotes in the declaration?