1

I try this: let textValue='<script></script>' but I get an error stated

Uncaught SyntaxError: Invalid or unexpected token unexpected token

Unterminated string literal

I am wondering do javascript currently forbid the use of <script> tag for string object.

1 Answers1

0

You can do it like this:

let textValue='<script>content<\/script>';
console.log(textValue);
Saeed Shamloo
  • 6,199
  • 1
  • 7
  • 18