Adding Newline into a string

Discussion in 'JavaScript' started by x2i, Jun 9, 2006.

  1. #1
    I have a string that eventually gets exported into a textarea control. However I want to be able to break certain bits of the string onto new lines. Any idea how yo do this?
     
    x2i, Jun 9, 2006 IP
  2. Slapyo

    Slapyo Well-Known Member

    Messages:
    266
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Have you tried inserting \n into your string where you want the newline to occur.

    This is my\n newline.
    Code (markup):
     
    Slapyo, Jun 12, 2006 IP
  3. x2i

    x2i Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanx it worked - should have known cos its similar to C :p
     
    x2i, Jun 19, 2006 IP