0

Possible Duplicate:
JavaScript string newline character?

I am aware that \n is the newline character but it does not work for IE. I have to use \r to get it to work for IE. Is there a javascript or JQuery function to insert a newline no matter the browser type?

1
  • \n has always worked for me in IE. Commented Aug 14, 2011 at 23:17

2 Answers 2

1

If you are in an HTML element $("#myelement").append('<br />');

If you are in a textarea $("#mytextarea").append('\n');

It's a very obvious answer, tell you if it works or not.

Sign up to request clarification or add additional context in comments.

1 Comment

I have tried \n in explorer but it does not work. I have to use \r to force it to go to the next line
1

Try using \r\n which is the windows newline. It should work in Linux and Unix as well though.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.