Multiple Lines of Text

The textarea element creates a multiline text box.

The form, autofocus, required, placeholder, and wrap attributes are new in HTML5

The rows and cols attributes specify the dimensions of the textarea. You can set the wrap attribute to hard or soft to control how line breaks are added to the text.

If you set the wrap attribute to hard, the content will have line breaks inserted. The other attributes work in the same way as the corresponding attributes on the input element.

 
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
      <form method="post" action="http://yourServer/form">
            <input type="hidden" name="recordID" value="1234" />
            <p>
                  <label for="name"> Name: <input value="Adam" id="name"
                        name="name" />
                  </label>
            </p>
            <p>
                  <textarea cols="20" rows="5" wrap="hard" id="story" name="story">
                  Tell us why
                  </textarea>
            </p>
            <input type="submit" value="Submit" />
      </form>
</body>
</html>
  
Click to view this demo.
Home 
  HTML CSS Book 
    HTML  

Related: