How to display <>

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ajay2552
    New Member
    • Apr 2007
    • 1

    #1

    How to display <>

    Hi,

    I have a query.

    All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it?

    One method is to use &lt, &gt ,&ltCompany&g t to display '<', '>' and '<Company>' respectively.

    But is there any freeware code available which could implement the above functionality without having to use &gt,&lt and such stuff???

    Please do respond!!

    Thanks
  • philleep
    New Member
    • Mar 2007
    • 74

    #2
    for < use &gt;
    for > use &lt;

    check this site out too

    cheer
    philleep

    Comment

    • KevinADC
      Recognized Expert Specialist
      • Jan 2007
      • 4092

      #3
      Originally posted by philleep
      for < use &gt;
      for > use &lt;

      check this site out too

      cheer
      philleep
      Thats exactly what he said in his post. He is looking for a alternate method.

      Comment

      • KevinADC
        Recognized Expert Specialist
        • Jan 2007
        • 4092

        #4
        Originally posted by ajay2552
        But is there any freeware code available which could implement the above functionality without having to use &gt,&lt and such stuff???
        Not that I know of. You could maybe use javascript but I don't know how it would know one < > from another in the html. Or use your text editor to find and replace < > with &lt; and &gt; before uploading the html document.

        With a server side script it would be possible but sounds like too much work for such a simple task unless the data is dynamically inserted into your html documents. You could do it with PHP (not that I know how) but once again it sounds like too much work unless the data is dynamic.

        Another alternative is to use a textarea tag but that works best for large chunks of html code you want to display as raw text and not individual words imbedded in sentences.

        Comment

        Working...