TEXTAREA Default Value

TL;DR Summary – TEXTAREA Default Value

Setting textarea default value is different than setting default value on an input element where you do something like this:

<input value=”this is default value” />

When dealing with  textarea you have to put the value between the tags. And size of textarea is defined by rows and cols attribures.

Full code for the image above is here:

<style>
  body { 
    background-color: orangered; 
    padding-top: 300px;
    font-size: 100px; 
    text-align: center;
  }
  textarea {
    font-size: 40px;
  }
</style>

<textarea rows="4" cols="50">
This is some default value!
</textarea>

And that’s all there is to setting default value to a textarea HTML element.

Also, speaking of input fields you might want to set input background color.

Until next time,
Will
Senior Developer Content Writer