View Full Version : New Line in Textarea

12-24-2005, 01:46 AM
This is driving me mad, 'log' is a textarea. Why isn't it inserting a new line?

function setLog() {
document.getElementById('log').innerHTML = "Ready." + "\n\n" + "----------------"

12-24-2005, 02:08 AM
How are you calling the function? What browser is it not working in? It works in Firefox. Must be a bug in IE, IE might use \r or something.

12-24-2005, 02:11 AM
I was viewing in IE. Just checked in FF and yup it works. I've tried \r, \r\n etc and nothing seems to work. Is there anything else I could try?

12-24-2005, 02:22 AM
try value instead of innerHTML

12-24-2005, 02:25 AM
Thanks, works now. :thumbsup: