Textarea & Select

 



Textarea Element

  • The textarea element is used when you need multiline text input from the user. This is particularly useful for comments, reviews, or any other type of input where the length is unpredictable.

<textarea name="comment" rows="4" cols="50">
      Enter your comment here...
</textarea>

  • The rows and cols attributes define the visible dimensions of the textarea.

The Select Element

  • The select element creates a dropdown menu for the user. It is useful when you have a predefined list of options for the user to choose from.

<select name="fruits">
      <option value="apple">Apple</option>
      <option value="banana">Banana</option>
      <option value="cherry">Cherry</option>
</select>

  • Each option inside the select tag represents an item in the dropdown list.

Combining Textarea and Select

  • you can combine 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>



Related Posts:

  • HTML Lists Types of HTML ListsUnordered List: An unordered list is used to create a list of items that are not in any particular order. Each list item… Read More
  • Unordered List HTML Unordered ListAn unordered list is a list of items that are not arranged in any specific, sequential order. Unlike ordered lists, the items… Read More
  • Ordered List HTML Ordered ListAn ordered list is used to create a list of items in a specific order, typically indicated by numbers.SyntaxKey PointsOrdered l… Read More
  • figure tag The figure element is particularly useful for images, illustrations, diagrams, videos, audio clips, and other types of media.Use the alt attribu… Read More
  • PICTURE TAG The <picture> element in HTML is used to provide multiple sources of an image, allowing the   browser to choose the most appropr… Read More

0 Comments:

Post a Comment

Do leave your comments