10 Html Attributes you might not know existed.

10 Html Attributes you might not know existed.

1.Autocomplete

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

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

<input name="Phone-number" id="Phone-number" autocomplete="off">
  1. 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="download.pdf" download> Download pdf </a>
  1. ContentEditable

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

<div contenteditable="true">You can now edit this text </div>
  1. 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>
  1. Accept

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

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

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

<input type="text" autofocus>
  1. Spell Check

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

<p contenteditable="true" spellcheck="true"> Check spelling </p>
  1. Hidden

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

<p hidden> I am Hidden </p>
  1. 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/mpeg">
</audio>
  1. Autoplay

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

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