The HTML accesskey attribute is a global attribute and specifies a shortcut key for activating/focusing a specific element. The attribute value should consist of one printable character. In HTML4.1, the accesskey attribute can be only used with the following elements: <a>, <area>, <button>, <input>, <label>, <legend>, and <textarea>. In HTML5, this attribute can be used with any element. The way of accessing the shortcut key varies… Continue reading HTML accesskey Attribute
Month: October 2022
HTML colspan Attribute
The HTML colspan attribute specifies how many columns a table cell should span. This attribute allows a single table cell to span the width of more than one column or cell. It has the same functionality as “merge cell” in Excel. You can use the colspan attribute on the <td> and <th> elements. When the colspan attribute is used on the <td> tag, it determines… Continue reading HTML colspan Attribute
HTML dir Attribute
The HTML dir attribute specifies the text direction of an element’s content. It is important for enabling HTML in right-to-left scripts (e.g. Arabic, Hebrew, etc.). Numerous languages are written with these scripts. You can use this attribute on any HTML element. It is a part of the Global Attributes. The dir attribute can have the following values: ltr: displays the text in left-to-right… Continue reading HTML dir Attribute
HTML defer Attribute
The HTML defer attribute specifies that a script is executed when a page has finished the parsing. It is a boolean attribute. This attribute works for external scripts and must be used only when the src attribute is present. There isn’t any difference between HTML 4.01 and HTML5. In XHTML, the defer attribute must be specified as <script defer=”defer”> as attribute minimization is forbidden. You… Continue reading HTML defer Attribute
HTML Autofocus Attribute
The HTML autofocus attribute is a boolean attribute, which defines that an <input> element must automatically get focus when the page loads. The autofocus attribute is new in HTML5. Syntax Applies to HTML <input> element. Example of the HTML autofocus attribute:
HTML Autocomplete Attribute
The autocomplete attribute defines if an input or a form field must have the autocomplete “on” or “off”. With the autocomplete attribute the browser predicts the value, and when a user starts typing in a field, the browser displays options to fill in the field, based on earlier typed values. The autocomplete can be “on” for the input, and… Continue reading HTML Autocomplete Attribute
HTML draggable Attribute
The HTML draggable attribute is an enumerated attribute and specifies whether the element is draggable or not (either with native browser behavior or the HTML Drag and Drop API). This attribute is commonly used in the drag and drop operations. Images and links are draggable by default. For other elements, you must set the ondragstart event. You… Continue reading HTML draggable Attribute
HTML download Attribute
The HTML download attribute specifies that the target will be downloaded when clicking on the hyperlink. It is used only if the href attribute is set. The value of the attribute is the name of the downloaded file. The browser automatically identifies the correct file extension and adds it to the file (e.g., .img, .txt, .pdf,). The browser will… Continue reading HTML download Attribute
HTML disabled Attribute
The HTML disabled attribute is a boolean attribute and specifies that the element must be disabled. This attribute can be used to prevent using the element until some condition has been met, such as selecting a checkbox. When present, the element does not respond to user actions and cannot be focused. Then, it is possible to make… Continue reading HTML disabled Attribute
HTML coords Attribute
The HTML coords attribute specifies the coordinates of an area in the image-map. To specify the shape, size, and placement of an area, it is used with the shape attribute. You can use this attribute on the <area> element. The top-left corner of an area has the 0,0 coordinates. The coords attribute can have the following values: x1, y1, x2, y2. It specifies… Continue reading HTML coords Attribute