InnerHTML with long text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smartic
    New Member
    • May 2007
    • 150

    InnerHTML with long text

    i need to enter long text having line brakes into div tag by innerHTML command
    this is an example of the text i want to enter:
    cat
    car
    dog
    boy
    it give me an error unterminated string literal
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    What's the need of line breaks inside the text? It won't be shown as line breaks in the HTML anyhow.
    If you want to give line breaks, use <br>.

    Is that it or I couldn't get it?

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Originally posted by hsriat
      What's the need of line breaks inside the text? It won't be shown as line breaks in the HTML anyhow.
      If you want to give line breaks, use <br>.

      Is that it or I couldn't get it?
      <br /> if you want to be technical ;]

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        That's if you're using XHTML. For HTML, <br> is correct.

        Comment

        Working...