Skip to main content

HTML Attributes You May Not Be Using

Hello everyone in this blog we will see some HTML Attributes which is very useful but many of you don't know or never use them. 

htmlcodeimage

So for your better understanding, we will see some attributes with examples.

for that here is the list


1. contenteditable:  This is the first attribute that is useful and you never use it .this attribute belongs to "Global Attributes". It specifies whether the content of an element is editable or not. When the contenteditable attribute is not set on an element, the element will inherit it from its parent

example:

<p contenteditable="false">This is an noneditable paragraph.</p>

2. downloadThe download attribute specifies that the target will be downloaded when a user clicks on the hyperlink.

This attribute is only used if the href attribute is set.
The value of the attribute will be the name of the downloaded file. There are no restrictions on allowed values, and the browser will automatically detect the correct file extension and add it to the file (.img, .pdf, .txt, .html, etc.).
If the value is omitted, the original filename is used.

The download attribute can be used on the following elements:

<a>  and <area>

example:

<a> tag example 

<a href="/images/myimage.jpg" download>

<area> tag example

<area shape="circle" coords="90,58,3" alt="Mercury" href="merglobe.gif" download="mercury">


3. hiddenThe hidden attribute is a boolean attribute.

When present, it specifies that an element is not yet, or is no longer, relevant.

Browsers should not display elements that have the hidden attribute specified.

The hidden attribute can also be used to keep a user from seeing an element until some other condition has been met (like selecting a checkbox, etc.). Then, a JavaScript could remove the hidden attribute, and make the element visible.

example:
<p hidden>This paragraph should be hidden.</p>


4. multiple: The multiple attributes is a boolean attribute.

When present, it specifies that the user is allowed to enter/select more than one value.

example:

<form action="/action_page.php">

  Select images: <input type="file" name="img" multiple><input type="submit">

</form>


5. poster: The poster attribute specifies an image to be shown while the video is downloading, or until the user hits the play button. 

If this is not included, the first frame of the video will be used instead.

example:

<video controls poster="/images/w3html5.gif">

<source src="movie.mp4" type="video/mp4">

  <source src="movie.ogg" type="video/ogg">  Your browser does not support the video tag.</video>


6. spellcheckThe spellcheck attribute specifies whether the element is to have its spelling and grammar checked or not.

The following can be spellchecked:
  • Text values in input elements (not password)
  • Text in <textarea> elements
  • Text in editable elements

example:
<p contenteditable="true" spellcheck="true">This is a paragraph.</p>




So these are the Attributes which are very useful to know.If you already know them then it's great for you to .your are a good learner you learn things in deep and use them well but if not then this article will be very useful for maybe it can solve your many problems. 

And if you know some useful not known attribute please tell us in comments.

Thank you for reading if you find useful this article please share it with friends and tell them about these attributes.







Comments

Post a Comment

Popular posts from this blog

How to deploy a website in 5 minutes on netlify.com for free hosting

Hello everyone, Welcome to our blog you are reading this meaning you want to know how to get free hosting for your website to make it live on your domain. So for that, we have something to show you how you can do that. There is a website called Netlify.com which gives free hosting for static websites. On the Netlify.com you can deploy your website with a postfix like netlify.com or with your own domain name example: like your company name is the web universe so it gives you some options to choose a domain with postfix thewebuniverse.netlify.com or you can add a purchased domain in that or you purchase instant on the Netlify.com like thewebuniverse.in I will explain step by step for the same: Step 1: Signup on the website netlify.com In the image here you can see that you can signup with Github, GitLab, Bitbucket, and with your email. For now, I am showing you from Email but I will write a separate blog for others like how we can directly deploy our Github, GitLab,

HTML Things you didn't know

Hello Everyone If you are reading that means you want to learn the HTML in deep. In this list, some tags, attributes, and properties of HTML elements are added. Possibly you didn't know them or maybe you know and using them in your website development. So let's start with our list Here is our list: Document Refresher : This is used in meta tag as an attribute http-equiv="refresh". If this is used in a meta tag then this meta tag will refresh the document in every given seconds. So if you want to refresh your document for some reason then it is a useful thing for you. example: < meta  http-equiv ="refresh"  content ="30" > here we have given 30 seconds so it will refresh in 30  seconds. Color Picker : This is useful to select a color from a color picker.it will apply in the input tag. In the input tag if you put type="color"  then it gives a color picker to select a color. example: < input type =" color "&