-3

The following line of js code is producing an unexpected identifier error, how might I correct this?

var bd_msg  = "<div>Have a great day!</div><div><br></div><div><span id="emoji_1f600">😀</span></div><div>From all of us.</div>";

Error reported is: Unexpected identfier 'emoji_1f600'. Expected ';' after variable declaration.

3
  • You cannot wrap the same kinds of quotes Commented Sep 8, 2020 at 12:14
  • you need to escape the " inside the string, \" Commented Sep 8, 2020 at 12:14
  • both answers are correct. Thank you both. Commented Sep 8, 2020 at 12:20

1 Answer 1

1
var bd_msg  = "<div>Have a great day!</div><div><br></div><div><span id='emoji_1f600'>😀</span></div><div>From all of us.</div>";

the double quote in between broke the string

Sign up to request clarification or add additional context in comments.

2 Comments

Please do not answer typo-type questions. OP cannot delete answered questions
Both answers are correct. Thank you both.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.