HTML Data Tag | Sakala Code
Sakala Code 1 year ago
sakalacode #html

HTML Data Tag

HTML data attributes, often referred to as data-* attributes, allow you to store extra information on standard HTML elements. The * in data-* can be replaced with any custom name you want, as long as it starts with data- and contains only letters, numbers, hyphens, and underscores. These attributes are often used to store custom data that can be accessed via JavaScript.

HTML Data Tag

In HTML, a data tag doesn't actually exist, but what you might be referring to is the use of data attributes that allow you to store extra information on standard, semantic HTML elements without having to use non-standard attributes or cluttering the markup.

HTML Data Tag with Example

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Data Attribute with Example</title>
</head>
<body>
  <div id="product-1" data-product-id="123" data-category="Technology" data-stock="25">
    Product Name: Smartphone
  </div>
</body>
</html>
0
321
HTML SVG

HTML SVG

1709870648.png
Sakala Code
1 year ago
HTML rt tag

HTML rt tag

1709870648.png
Sakala Code
1 year ago
Php Associative Array

Php Associative Array

1709870648.png
Sakala Code
1 year ago
Php Bitwise Operators Examples

Php Bitwise Operators Examples

1709870648.png
Sakala Code
1 year ago
HTML address tag

HTML address tag

1709870648.png
Sakala Code
1 year ago