Twango Posted January 19, 2010 Share Posted January 19, 2010 Hello, i'm using document.getElementById() to jump to a new line in a text area, for example, i want the text area to display:<p>hello</p>instead of <p>hello</p>document.getElementById('idhere').value="whatever" + <br/> is not working, why?thanks! Link to comment Share on other sites More sharing options...
justsomeguy Posted January 20, 2010 Share Posted January 20, 2010 First, your line break is not in quotes. It needs to be quoted too. Second, <br/> is not a line break, it's an HTML tag. If you want to add a line break you use the sequence "\n". Link to comment Share on other sites More sharing options...
Twango Posted January 20, 2010 Author Share Posted January 20, 2010 Thanks, also, any way to just 'write'? not edit the value? Link to comment Share on other sites More sharing options...
Twango Posted January 20, 2010 Author Share Posted January 20, 2010 what i'm trying to achieve is simply a button that adds something to a text area, Link to comment Share on other sites More sharing options...
justsomeguy Posted January 20, 2010 Share Posted January 20, 2010 You're doing it the right way, you append to the existing value. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.