How to set textarea default values
Editor to share with you how to set the default value of textarea, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
It is found that the default value of textarea tag is different from that of input tag. Input has a value attribute, but textarea does not, so if you need to set the default value in textarea, you can use the following methods.
Textarea setting default value method
1. Just like this:
Hello!
two。 Or get the element according to id and set the default value
Document.getElementById ("T1") .value = "hello!"
But remember, the following is wrong!
Textarea add default value value
Textarea cannot add value.
But a simple analogy:
What do we do when we need to edit something and use textarea?
You can do that. Add an ID.
And then append it with script
Then refresh the first page
Textarea display default values
Click not to show the default value, mouse away if there is no content to display the default value, if there is content to display the content.
Please enter the specific content
Enter the box fillet style:
Border-radius:10px
Select secondary menu options:
Labradorretriever
Goldenretriever
Pug
The display is similar to the drop-down tree menu.
The above is all the contents of the article "how to set textarea defaults". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!