Show Html As Plain Text
im looking for a way to show html as html without the browser reading it, i found but once i start it i can't stop it for example:
Solution 1:
plaintext
has long been deprecated, just use >
and <
<span> dobeediedabiedadadee olleeeeee</span>
DEMO: Fiddle
Solution 2:
You could always use javascript to escape the HTML. Here is a fiddle.
html.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
Solution 3:
The following link describes the difficulty in using <plaintext>
. long story short it is not fully supported in any browser and you should be using <pre>
instead.
Solution 4:
<plaintext>
is not a pair tag. From that tag to the rest of the page, everything is interpreted as text. However, this is not standard and obsolette in HTML5:
Examples No, really. don't use it.
It is literally written in the w3 reference
Solution 5:
Use PRE
<pre><span> dobeediedabiedadadee olleeeeee</span></pre><h1>hi</h1>
Post a Comment for "Show Html As Plain Text"