From the course: HTML and CSS: Creating Forms
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Textarea element
From the course: HTML and CSS: Creating Forms
Textarea element
- [Instructor] The textarea element is similar to the text input type in that any characters can be entered. The difference is that a textarea element can collect text that takes up several lines and allows the user to hint the Enter key to start a new line while they're typing in the text area. For this one, I'm going to ask the user to write a poem since that's something that takes up several lines. So I'm going to start with a paragraph tag, and then inside that, put textarea, give it an id of poem and a name of poem. And then the closing textarea. And then below that, label for poem. And the question or the instructions will be write a poem and then the closing label tag. One thing to note for the textarea element is that you need an opening and closing tag, even if there's nothing in between them. So back in the browser, I'm going to refresh and you see it's not just a one-line box like I got for inputs. I can type in there and hit Enter, and it lets me keep typing more text. If…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Basic form structure4m 11s
-
(Locked)
Name, id, and label5m 24s
-
(Locked)
Email and URL input types5m 1s
-
(Locked)
Number and tel input types6m 7s
-
(Locked)
Date and time input types4m 34s
-
(Locked)
Radio buttons and checkboxes5m 54s
-
(Locked)
Select element5m 47s
-
(Locked)
Textarea element2m 38s
-
(Locked)
Other input types4m 54s
-
(Locked)
Buttons3m 27s
-
(Locked)
Placeholder attribute2m 54s
-
(Locked)
Other form attributes3m 57s
-
(Locked)
-
-
-
-