How to Display HTML/JavaScript Codes on Blogger Posts

Recently, a reader queried me this little doubt. How do I show the HTML/JavaScript codes on my Blogger posts? So, I decided to post it as a tidbit here.

Your HTML code has tags, enclosed in angle brackets (< and >). All you need to do is replace these angle brackets with these:

In place of <, use &lt; and in place of >, use &gt;. Keep everything else the same and publish your code, it will be shown as code itself on the published post.


In place of this code: <a href="">CW</a> you will use:
&lt;a href=""&gt;CW&lt;/a&gt;

Copyright © Lenin Nair 2008

2 Opinions:

  1. Yes Lenin,

    It works fine. Thanks

    - Uditha

  2. Thanks for the comment, Uditha.


Comments are moderated very strictly