Quoting Strings with Single Quotes - cannot find error

Tell us what’s happening:
My answer here below. I’ve checked in another post which mentions the same answer as correct by 3 different users. Yet FCC does not accept as the answer. Could someone pls tell me what’s wrong? Thx!

Your code so far

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

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36.

Link to the challenge:
https://www.freecodecamp.org/challenges/quoting-strings-with-single-quotes

Remove the initial statement as this worked for me:

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

1 Like

Thx Alex it worked! I was reading on a post about another challenge someone had the same issue. Bad bug on FCC it leaves you wondering about the answer when in fact it has nothing to do with it…

When I got to the next challenge there was indeed an explicit instruction saying “change this line”. So I went back to the challenge in question to check if the instruction was there and I had missed it. It is not. I think they have missed entering the instruction text in this challenge although the format is being checked.

1 Like