Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

how to display "<"'s in html

Options
  • 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 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 Posts: 2,781 ✭✭✭amen


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


Advertisement