Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8222885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:25:45+00:00 2026-06-07T14:25:45+00:00

In almost every tag in HTML, characters like < (start tag) and & (character

  • 0

In almost every tag in HTML, characters like <(start tag) and &(character escape) must be escaped.

However, inside of a <script> tag this does not seem to apply! I am able to define in HTML the characters plainly and also retrieve them using jQuery, for example var my_unescaped_text = $('script[type="text/mytexttype"]');

Are there any other tags that do this? Is there some way that I could possibly have this sort of thing become visible in a <pre> tag without using javascript? (yeah, I know, that definitely sounds like a tall order…)

What about <input> or <textarea> tags? One can definitely write these characters in a text input field, and that is visible and style-able (which satisfies my perhaps unclear goal). Is there anything else? The text I’m trying to display (pre-javascript processing) is Markdown and a <pre> is perhaps best suited for it though a <textarea readonly="readOnly"> could probably be made to look exactly like a <pre>.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T14:25:47+00:00Added an answer on June 7, 2026 at 2:25 pm

    You must always escape when embedding arbitrary text into HTML.

    However, special rules apply for the content of the <script> tag, and they allow an unescaped < under certain conditions, namely, that it is not part of a </script>. Therefore, the correct encoding of "<" in JavaScript is "\u003c".

    For security reasons, you shouldn’t use inline JavaScript in the first place. Instead, use data- attributes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Almost every ios app now has something like Feed option. Programming that usually includes
This happens almost every time I init a new repo. Start a new project.
Almost every spec file I come accross I end up writing stuff like: before
Almost every major news media outlet is reporting that Apple will stop using Google
Almost every pseudorandom generator in C/C++ (Mersenne, ...) uses some kind of internal state,
Almost every flash player has an option to display how much of buffer (or
I used Term::ShellUI and almost every thing is working as expected but the issue
Every place I've worked in the past 15 years has had, on almost every
I find myself typing import numpy as np almost every single time I fire
some weeks from now I've been receiving this strange message almost every time I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.