1<textarea id="txtid" name="txtname" rows="4" cols="50" maxlength="200">
2A nice day is a nice day.
3Lao Tseu
4</textarea>
1<html>
2 <head>
3 <title>Textarea Elements</title>
4 </head>
5 <body>
6 <form>
7 <label for="multiLineInput"> <!-- Add the label if you want -->
8 <p>This is an input element that can include new lines:</p>
9 <textarea rows="5" cols="50" id="multiLineInput"></textarea>
10 </label>
11 <!-- rows for length, cols for width. Both aren't required -->
12 </form>
13 </body>
14</html>
15
1// To set the textarea value, you must insert the TEXT into the element.
2<textarea>VALUE</textarea>
3// javascript
4var textarea = `<textarea>${value}</textarea>`;
5document.getElementById('my_textarea_id').textContent = 'foo'
6// php
7$value = 'foo';
8$textarea = "<textarea>$value</textarea>";
9echo $textarea;