0

I want to display the Source code of Html page as it is written on the notepad so pls, How to prevent browser from parsing the code and display the original source code of the Html Page?

2

2 Answers 2

1

You can use a Syntax Highlighter like this one: https://code.google.com/p/syntaxhighlighter/

Or you can use <code></code>

So <div class="helloworld"></div> would become:

<code>&lt;div class="helloworld"&gt;&lt;/div&gt;</code>

&lt and &gt stands for the less than and greater than brackets.

Sign up to request clarification or add additional context in comments.

Comments

0

you can use "pre" tag to display source code:

<pre>code stuff</pre>

if you want to use class name with the syntax highlighter you can try as below:

<pre><code class="xyz">headerFunction</code></pre> 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.