im looking for a way to show html as html without the browser reading it,
i found <plainttext>
but once i start it i can't stop it
for example:
<plaintext>
<span> dobeediedabiedadadee olleeeeee</span>
</plaintext>
<h1>hi</h1>
in this example the span had to be shown as text and the h1 as a header, but the output is:
<span> dobeediedabiedadadee olleeeeee</span>
</plaintext>
<h1>hi</h1>
</body>
</html>
here a JSFiddle link:
JSFiddle
a other solution as plaintext is also welcome
thanks for your time.
plaintext
has long been deprecated, just use >
and <
<span> dobeediedabiedadadee olleeeeee</span>
DEMO: Fiddle
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.
http://reference.sitepoint.com/html/plaintext
You could always use javascript to escape the HTML. Here is a fiddle.
html.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
<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
Use PRE
<pre>
<span> dobeediedabiedadadee olleeeeee</span>
</pre>
<h1>hi</h1>
it is compatibility issue some browser completely ignores coding of
have a look at this link http://reference.sitepoint.com/html/plaintext
i would suggest you use instead