Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

how to display "<"'s in html

  • 29-04-2003 10:55AM
    #1
    Closed Accounts Posts: 10


    I have a javascript populating a table with text from a database. Some of the text strings have the symbols < and > in them and consequently do not display in a browser. eg the string below, "hello world<Paddy>" displays as just "hello world". Does the browser interpret Paddy as an invalid html tag and just ignores it?

    How can I display the brackets?

    <td>hello world <Paddy></td>


Comments

  • Registered Users, Registered Users 2 Posts: 1,186 ✭✭✭davej


    Use the <pre> </pre> tags around anything you want as a literal.

    davej


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    hello world &lt;Paddy&gt;
    
    HTML Special Entities

    adam


  • Registered Users, Registered Users 2 Posts: 2,781 ✭✭✭amen


    if you are using aps
    u could use server.htmlencode(text)
    which would do it for you


Advertisement