Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

html attributes use and syntax

The document outlines various HTML attributes such as `disabled`, `max`, `min`, `pattern`, `readonly`, `placeholder`, `required`, `autocomplete`, `autofocus`, `height`, `width`, and `multiple`, detailing their syntax and usage. Each attribute is accompanied by examples demonstrating how they can be implemented in HTML. The notes are authored by Mr. Sandesh Sangram Shinde.

Uploaded by

rohanmhetre93
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

html attributes use and syntax

The document outlines various HTML attributes such as `disabled`, `max`, `min`, `pattern`, `readonly`, `placeholder`, `required`, `autocomplete`, `autofocus`, `height`, `width`, and `multiple`, detailing their syntax and usage. Each attribute is accompanied by examples demonstrating how they can be implemented in HTML. The notes are authored by Mr. Sandesh Sangram Shinde.

Uploaded by

rohanmhetre93
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

NOTES:-

Here are the syntaxes and uses for the specified HTML attributes:

### 1. `disabled`
**Syntax:** `<input type="text" disabled>`, `<button disabled>`

**Use:** Disables an input element, preventing user interaction.

**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">`

**Use:** Specifies the maximum value for an input element.

**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">`

**Use:** Specifies the minimum value for an input element.

**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:**

BY MR. SANDESH SANGRAM SHINDE


NOTES:-

```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">
```

BY MR. SANDESH SANGRAM SHINDE


NOTES:-

### 9. `autofocus`
**Syntax:** `<input type="text" autofocus>`

**Use:** Automatically focuses on the input field when the page loads.

**Example:**
```html
<input type="text" autofocus>
```

### 10. `height` and `width`


**Syntax:** `<img src="image.jpg" height="100" width="200">`

**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>
```

### 11. `multiple`


**Syntax:** `<input type="file" multiple>`, `<select multiple>`

**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>
```

BY MR. SANDESH SANGRAM SHINDE

You might also like