Skip to content

Commit 5a273c3

Browse files
Merge pull request #3 from Ninja-Vikash/attribute
new attribute added in input tag
2 parents 6575ed0 + e044c8d commit 5a273c3

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

03 - Attributes/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ Attributes enhance the flexibility and functionality of HTML elements, making th
142142
| | [min](https://github.com/Ninja-Vikash/HTML-Mastery-Guide/tree/main/03%20-%20Attributes#min-and-max) | 18 | For number and date inputs, specifies the minimum allowed values. |
143143
| | [max](https://github.com/Ninja-Vikash/HTML-Mastery-Guide/tree/main/03%20-%20Attributes#min-and-max) | 99 | For number and date inputs, specifies the maximum allowed values. |
144144
| | [pattern](https://github.com/Ninja-Vikash/HTML-Mastery-Guide/tree/main/03%20-%20Attributes#pattern) | [0-9]{5} | Specifies a regular expression pattern that the input value must match for the form to be submitted. |
145+
| | [accept]() | .jpg, .png, .webp, etc | For describing input file types (extensions like .jpg, .png, .webp, etc) are allowed. |
145146

146147
### Meta Tag Attributes
147148
#### Character Encoding
@@ -415,6 +416,13 @@ The `<input>` tag in HTML is a versatile element used to create various form con
415416
```
416417
> Specifies a regular expression pattern that the input value must match for the form to be submitted.
417418
419+
#### accept
420+
```html
421+
<input type="file" accept=" .jpg">
422+
```
423+
> ![NOTE]\
424+
> For describing input file types (extensions like .jpg, .png, .webp, etc) are allowed.
425+
418426
These are just a few of the many attributes you can use with the `<input>` tag. The specific attributes you use depend on the type of form control you are creating and the desired behavior of your form.
419427

420428
## Special Attribute

03 - Attributes/index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ <h2>Navigation Using Anchor tag and using <b>href</b> Attribute.</h2>
1313

1414
<hr>
1515

16+
<!-- Attributes for input tags -->
17+
<h2>Some rare attributes</h2>
18+
<input type="file" accept=" .jpg">
19+
<input type="text" inputmode="numeric">
20+
1621
<!-- Attributes for media files -->
1722
<h2>Showing Images using src Attribute and alt Attribute for alternate text for broken images</h2>
1823
<img src="assets/img.jpg" width="100%" alt="rose"> <!-- Rendering any image from local -->

0 commit comments

Comments
 (0)