posted 9/5/2010 by Raghav Khunger
Sometimes it is needed to add some text with linebreaks manually in textarea. It can be done by adding slash r and slash n (\r\n). Below is the sample code to do the same.
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <form id="form1" runat="server"> <textarea id="myTextBox" style="width:500px;height:300px"></textarea> </form> </body> <script type="text/javascript"> var myTextBox = document.getElementById('myTextBox'); var mytext='This is my text' +'\r\n'+ 'This is my text' + '\r\n' + 'This is my text' + '\r\n' + 'This is my text' + '\r\n' + 'This is my text' + '\r\n'; myTextBox.value = mytext; </script> </html>
What kind of email newsletter would you prefer to receive from CodeAsp.Net?18