Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

248
Views
JavaScript Console Changing String Text

I was just doing stuff in microsoft edge console, and I noticed that when I type in the following:

str = "<script>"

it returns with the value of the string as:

'<\script>'

Why did it add a backslash?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It's formatting it the way you should do it if you were writing the string in a <script> block of an HTML file. In these blocks you should not write <script> and </script> literally, because they'll be parsed as starting or ending the block. The escaped character prevents them from being recognized as those HTML tags.

This is somewhat related to Why split the <script> tag when writing it with document.write()?

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!