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.

Example:

In place of this code: <a href="http://cutwriting.blogspot.com">CW</a> you will use:
&lt;a href="http://cutewriting.blogspot.com"&gt;CW&lt;/a&gt;


Copyright © Lenin Nair 2008

2 Opinions:

  1. Yes Lenin,

    It works fine. Thanks

    Regards:
    - Uditha

    ReplyDelete
  2. Thanks for the comment, Uditha.

    ReplyDelete

Comments are moderated very strictly