In addition to the basic input types, HTML forms offer other controls like textarea
and select
for richer user interaction. These elements allow for more complex data collection and provide a better user experience.
textarea
element is used when you need multiline text input from the user. <textarea name="comment" rows="4" cols="50">
Enter your comment here...
</textarea>
textarea
and select
in the same form to capture varied types of user input.<form action="/submit">
<textarea name="comment" rows="4" cols="50">Enter your comment here...</textarea>
<select name="fruits">
<option value="apple">Apple</option>
<option value="banana">Banana</option>
<option value="cherry">Cherry</option>
</select>
<input type="submit" value="Submit">
</form>