How-to articles, tricks, and solutions about ATTRIBUTE

How to Add a Mouseover Text with HTML

In this tutorial, find out how to create a mouseover text description without Javascript. Use the HTML <div> or <span> element with the “title” attribute.

How to Allow Only Positive Numbers in the Input Number Type

In this snippet, we’ll demonstrate how to allow only positive numbers in the input number type. You can use the “min” attribute to specify restrictions.

How to Allow the File Input Type to Accept Only Image Files

In this tutorial, we’ll show how to allow the file input type to accept only image files or certain image file extensions. Use the HTML “accept” attribute.

How to Assign a Checked Initial Value to the Radio Button

In this tutorial, find out how you can assign a checked initial value to the radio button with HTML. To achieve that goal, you need to use the checked attribute.

How to Change the Style of the "title" Attribute Within an Anchor Tag

Since actually, we cannot style the “title” attribute inside an anchor tag, we suggest using some other methods of styling the tooltip inside an anchor tag.

How to Disable Form Fields with CSS

In this tutorial, we’ll demonstrate how it is possible to disable form fields with some CSS. For that, you can use the pointer-events property set to “none”.

How to Set Default HTML Form Focus Without Javascript

In this tutorial, you’ll see how to set the default HTML form focus. This can be done without Javascript. For that, use the HTML “autofocus” attribute.

How to Set the Equivalent of "src" Attribute of an <img> Tag in CSS

In this snippet, you can find the solution of setting the equivalent of “src” attribute of an <img> tag. For that, use the content or background-image properties.

How to Use the "required" Attribute on the <select> Element in HTML5

The “required” attribute works only on empty values. In this snippet, we’ll show how to apply it to the HTML <select> element. Read and find some examples.

How to Use the "required" Attribute with the Radio Input Field

Read this snippet to find out how you can use the “required” attribute with the radio Input field. Here, you can also find an example and try it yourself.

How to Use the HTML accept Attribute

In this tutorial, we’ll explain what is the HTML accept attribute and why it is used. Use this attribute to specify file types the user is allowed to choose from.

What is aria-label and How to Use It

In this snippet, you can learn what is aria label, as well as when and how it can be used. Read our tutorial and find examples of using the aria-label attribute.

What is the Difference Between the "id" and "name" Attributes

In this snippet, we’re going to discuss the differences between the “id” and “name” attributes, after which you’ll make a better decision of their usage.

What is the Difference Between the hidden and aria-hidden Attributes

On this page, you will learn what is the difference between the hidden and aria-hidden attributes. Read our snippet and see examples with these attributes.