Basic JavaScript - Quoting Strings with Single Quotes

Tell us what’s happening:

Describe your issue in detail here.

Your code so far

var 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/118.0.0.0 Safari/537.36

Challenge Information:

Basic JavaScript - Quoting Strings with Single Quotes

Hey @beri12
I think you need to get rid of the back ticks and then try to run your code again.

use backticks (``) to create a template literal, and correct the placement of the double quotes within the HTML attribute values. The target` attribute value should also be enclosed in double quotes.

If you want to use back ticks (``)at the beginning and end of the string than you don’t need to use single quotes(‘’).

Above your code has back ticks and single quotes at the beginning and end of the String but you don’t need to use both (back ticks and single qoluotes). You can use back ticks(``) or single quotes (‘’).

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.