Custom attributes

Custom attributes are values that you can assign to HTML elements to store extra information about those elements. They are defined using the data- prefix, followed by the attribute name.

For example, you could define a custom attribute called data-product-id on an HTML element like this:

<div data-product-id="12345">This element represents a product with ID 12345</div>

Custom attributes are often used to store data that is used by JavaScript code to perform some action on the element. For example, you could use a custom attribute to store the ID of a product, and then use JavaScript to retrieve the ID and send it to the server when the user clicks on a button.

Custom attributes are not intended to be used as a replacement for standard HTML attributes. They are intended to be used to store data that is not relevant to the element's content or presentation, and that is not covered by any of the standard HTML attributes.

Custom attributes

You can add custom attributes from your element styling tab

Click Add new attribute

Enter your values here

To add attributes to links you can do so by pressing this icon

Last updated

Was this helpful?