In this article, you’ll learn about 11 HTML attributes that you probably haven’t heard of yet.
1. multiple
This attribute allows users to enter multiple values. You can use the multiple attribute with tags and
Using multiple Attribute With
Using multiple Attribute for File Input
By using the multiple attribute for file input, you can select multiple files (by holding the Shift or Ctrl keys).
Using multiple Attribute for Email Input
By using the multiple attribute for email input, you can enter a list of comma-separated email addresses. All the white spaces will be removed from each address in the list.
2. contenteditable
You can make the HTML content editable on a web page using the contenteditable attribute. This is a global attribute, i.e, it’s common to all HTML elements.
3. spellcheck
The spellcheck attribute specifies whether the element may be checked for spelling errors or not. You can spellcheck text in the
4. download
You can download a resource using the download attribute. The download attribute tells the browser to download the specified URL instead of navigating to it. You can use the download attribute with tag and tag.
Note: The download attribute only works with same-origin URLs. It follows the rules of the same-origin policy.
5. accept
The accept attribute of the tag specifies the type of files a user can upload. You can specify a comma-separated list of one or more file types as its value.
Accepting an Audio File
Accepting a Video File
Accepting an Image File
Accepting a Microsoft Word File
Accepting PNG or JPEG Files
Accepting a PDF File
6. translate
The translate attribute tells the browser that the element should be translated or not when the page is localized. It can have 2 values: “yes” or “no”.
7. poster
The poster attribute is used to show an image while the video is downloading or until the user plays the video.
Note: If you don’t specify anything, nothing is displayed until the first frame is available. When the first frame is available, it’s shown as the poster frame.
8. inputmode
The inputmode attribute indicates the browser which keyboard to display when a user has selected any input or textarea element. This attribute accepts various values:
None
Numeric
Tel
Decimal
URL
Search
9. pattern
The pattern attribute of the element allows you to specify a regular expression for which the element’s value will be validated against. You can use the pattern attribute with several input types like text, date, search, URL, tel, email, and password.
10. autocomplete
The autocomplete attribute specifies whether the browser should automatically complete the input based on user inputs or not. You can use the autocomplete attribute with several input types like text, search, URL, tel, email, password, date pickers, range, and color. You can use this attribute with the elements or