Unlike the HTML <input>
element, the <textarea>
element does not have a value
attribute to set the default value. To do that on an HTML <textarea>
element, the value must be added between the opening and closing tags, for example, like so:
<textarea>Default value goes here...</textarea>
The <textarea>
element supports multi-line content, therefore, any line-breaks (or whitespaces) added between the opening and closing tags would be interpreted as is. For example, the following would set the default value on the <textarea>
element split over three lines:
<textarea> Line 1 Line 2 Line 3 </textarea>
This post was published by Daniyal Hamid. Daniyal currently works as the Head of Engineering in Germany and has 20+ years of experience in software engineering, design and marketing. Please show your love and support by sharing this post.