html attributes use and syntax
html attributes use and syntax
Here are the syntaxes and uses for the specified HTML attributes:
### 1. `disabled`
**Syntax:** `<input type="text" disabled>`, `<button disabled>`
**Example:**
```html
<input type="text" disabled>
<button disabled>Submit</button>
```
### 2. `max`
**Syntax:** `<input type="number" max="10">`, `<input type="date" max="2024-12-31">`
**Example:**
```html
<input type="number" max="10">
<input type="date" max="2024-12-31">
```
### 3. `min`
**Syntax:** `<input type="number" min="1">`, `<input type="date" min="2024-01-01">`
**Example:**
```html
<input type="number" min="1">
<input type="date" min="2024-01-01">
```
### 4. `pattern`
**Syntax:** `<input type="text" pattern="[A-Za-z]{3}">`
**Use:** Specifies a regular expression that the input element's value must match for the form to be
submitted.
**Example:**
```html
<input type="text" pattern="[A-Za-z]{3}">
### 5. `readonly`
**Syntax:** `<input type="text" readonly>`
**Use:** Makes the input field read-only, preventing the user from modifying the value.
**Example:**
```html
<input type="text" value="Read-only text" readonly>
```
### 6. `placeholder`
**Syntax:** `<input type="text" placeholder="Enter your name">`
**Use:** Provides a hint to the user about what to enter in the input field.
**Example:**
```html
<input type="text" placeholder="Enter your name">
```
### 7. `required`
**Syntax:** `<input type="text" required>`
**Use:** Specifies that the input field must be filled out before submitting the form.
**Example:**
```html
<input type="text" required>
```
### 8. `autocomplete`
**Syntax:** `<input type="text" autocomplete="on">`, `<input type="text" autocomplete="off">`
**Use:** Specifies whether the browser should autocomplete the input field.
**Example:**
```html
<input type="text" autocomplete="on">
<input type="text" autocomplete="off">
```
### 9. `autofocus`
**Syntax:** `<input type="text" autofocus>`
**Use:** Automatically focuses on the input field when the page loads.
**Example:**
```html
<input type="text" autofocus>
```
**Use:** Specifies the height and width of an element, typically used for images, videos, or iframes.
**Example:**
```html
<img src="image.jpg" height="100" width="200">
<video src="movie.mp4" height="300" width="500" controls></video>
```
**Use:** Allows the user to select multiple values for an input element.
**Example:**
```html
<input type="file" multiple>
<select multiple>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
```