The <textarea>
element establishes a multi-line input field, known as a text area:
Example
<textarea name=”message” rows=”10″ cols=”30″> The cat was playing in the garden. </textarea> |
The rows attribute determines the visible number of lines in a text area, while the cols attribute specifies its visible width.
Here’s how the HTML code above will appear when rendered in a browser:
You can also specify the size of the text area using CSS:
Example
<textarea name=”message” style=”width:200px; height:600px;”> The cat was playing in the garden. </textarea> |
The <button> element specifies a button that can be clicked.
Example
<button type=”button” onclick=”alert(‘Hello World!’)”>Click Me!</button> |
Reminder: Ensure to define the type attribute for the button element at all times. Various browsers might employ distinct default types for the button element. |