...

View Full Version : New Line in Textarea



mark87
12-24-2005, 12: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" + "----------------"
}

_Aerospace_Eng_
12-24-2005, 01: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.

mark87
12-24-2005, 01: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?

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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum