Basic JavaScript - Quoting Strings with Single Quotes

Tell us what’s happening:

Describe your issue in detail here.

Your code so far

const myStr = "<a href=/"'http://www.example.com\" target="_blank'>Link</a>";

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0

Challenge Information:

Basic JavaScript - Quoting Strings with Single Quotes

Hi @ndumisomvelase10111, and welcome to the forums!

You are very close with your answer, but be sure to use \ instead of a / to escape characters in JavaScript. And you will need to escape the double quotes in your target attribute, as well.

1 Like