[ACCEPTED]-HTML tag to prevent HTML tags to be executed?-xhtml
This:
The html code for < is &lt;
Renders as:
The html code for < is 2 <
The basic strategy is to escape 1 the &
as &
You are going to have to do it manually.
Here you 2 have the full encoding table. The most commonly 1 used codes are:
Character Entity Number Entity Name Description
" " " quotation mark
' ' ' apostrophe (does not work in IE)
& & & ampersand
< < < less-than
> > > greater-than
In this case, you DON'T need to encode it. Try 2 this one:
<xmp> html < < </xmp>
I'm not sure about cross browsers 1 support, but works on IE7,FF3,Chrome3
I suppose you don't want the entity to be 2 rendered? If you want to display <
you'll 1 have to use the entity for the ampersand: &
.
The html code for < is <
That is, type 1 < is &lt;
.
If you have access to server side scripting 4 capabilities, you might be able to use utility 3 functions of that platform. For example, in 2 PHP you might use the htmlentities
function to your 1 advantage:
echo htmlentities("The html code for < is <");
You could use a <pre> < </pre>
sequence
0
You need to encode it. For example, '<' = '<'
Here 2 is the list.
So in your case it will end up like 1 this:
The html code for < is & l t ;
<textarea readonly rows="2" cols="50" style="border:none; color:lightGray; background-color:black;">
<<line1>>
<<line2>>
</textarea>
is the only supported option . but its not 6 enabled neither here neither on GitHub .
i'm 5 5min with HTML, so also would appreciate 4 anyone enhancing it with dynamic size, achieved 3 trough the tag's HTML/CSS attributes, or, if 2 its not possible, trough a small embed Java 1 Script .
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.