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:

  • Link & Script TagsThe <link> and <script> tags are essential elements within an HTML document's <head> section. The… Read More
  • Video & Audio Tags<video> TagThe <video> HTML element embeds a media player that supports video playback into the document.The <video> tag create… Read More
  • SVG in HTML What is SVG?SVG stands for Scalable Vector Graphics. Unlike raster images like PNGs or JPGs, SVGs are not pixel-based. They're composed of vector… Read More
  • Textarea & Select Textarea ElementThe textarea element is used when you need multiline text input from the user. This is particularly useful for comment… Read More
  • iFrames in HTMLWhat is an iFrame?An iFrame is an HTML element that enables an inline frame for the embedding of external content. Essentially, you can load another w… Read More

0 Comments:

Post a Comment

Do leave your comments