HTML Attributes.

HTML (Hyper Text Mark-up Language).

It is used to create content, structures, formats and display it on the web browser.

Here are 10 HTML attributes you might not know exist:

Autocomplete.

→ The autocomplete attributes specify whether the browser is allowed to aid in filling out the form fields or not.

<input name="Phone-number" id="Phone-number" autocomplete="off">

→ If turned on, it will assist users with auto-filling options such as email, phone numbers, nationality, and so on.

Download.

→ The download attribute on an anchor tag specifies that the file/object should be downloaded to the local storage when a user clicks on the hyperlink.

<a href="document.pdf" download><Download pdf</a>

Autofocus.

→ The autofocus attribute indicates that the particular element should be focused on page load.

<input type="file" autofocus>

SpellCheck.

→ The spellcheck attribute defines whether the element is checked for spelling errors.

<p contented table="true" spellcheck="true">check spelling</p>

Hidden.

→ The hidden attribute specifies whether or not the element is visible.

<p hidden>I am hidden</p>

Controls.

→ The controls attribute specifies whether or not the audio video controls should be displayed on the default player.

<audio controls><source src="song.mp3" type="audio/mepg"></audio>

Autoplay.

→ The autoplay attribute ensures that the audio/video will automatically start playing as soon as it is loaded.

<video autoplay src="https://www.sample.com/my video.mp4" poster="image.png"></video>

Readonly.

→ The readonly attribute specifies that an input field is read-only and can't be edited.

<input type="text" name="js" value="language" readonly>

Contenteditable.

→ The contenteditable attribute allows the user to edit the content of an element.

<div contenteditable="true"> You can now edit this text!</div>

Accept.

→ The accept attribute value is a string that defines the file types the file input should accept.

<input type="file" accept=".jpg, .png">

Furthermore, this attributes provides additional information about the element.

Isn't learning new skills fun?

coding is fun.