I want to set a default value for my html <textarea>
. I read from a material that to add default value you have to do something like <textarea>This is default text</textarea>
. I did that but it doesn't work. What's the right thing to do?
The DOM Textarea defaultValue Property is used to set or return the default value of the textarea field. Syntax: It is used to return the defaultValue property.
Note: The default value of a text area is the text between the <textarea> and </textarea> tags.
Here is my jsFiddle example. this works fine:
<textarea name='awesome'>Default value</textarea>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With