When you write a textarea, the default value will be replaced with that string. Which "href" value should I use for JavaScript links, "#" or "javascript:void(0)"? The tags. Change text box width according to the text inside, How to do validation for 10 digit mobile number Using jQuery, Javascript Limit Characters in textbox with HTML & CSS, Generating <button type="submit"> with the form API, Dynamically expand height of input type "text" based on number of characters typed into field. If you want a default value, then putting in the model would achieve that. If it is specified, it must be a positive integer. Specifies the visible width of a <textarea> element in average character widths. The textarea default value is always a string. Find centralized, trusted content and collaborate around the technologies you use most. Returning defaultValue. The textarea default value can be set in your preferences. Notice how it disappears when you start typing into the box. Change the default value of a text field: getElementById("myText"). This way the empty textarea has the default textarea value, which is what it should be. Defaults to 20 if not specified. What's the best way to roleplay a Beholder shooting with its many rays at a Major Image illusion? 29.9k 6 6 gold badges 84 84 silver badges 113 113 bronze badges. It does not set an initial value if none is provided when the form is rendered in a view. So not a good solution. This is super handy for people who want to put something in their textarea that will be set to a default value, but doesnt always need to be that default. The HTML specification doesn't define where the baseline of a