Skip to content
Advertisement

Unexpected token ‘<'

I am using this to add html between a div tag but it displays Unexpected token '<'

JavaScript

The x["solution"] is a json file which contains html like <strong> bold </strong> etc.

Advertisement

Answer

You forgot to quote the right part of the equality. This code is generating:

JavaScript

Also, you can use a single formatted string which would look like:

JavaScript

and would generate

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement