Read HTML Data Attribute

Read a data- attribute from an HTML element


Demos & Screenshots

No screenshots provided yet. Have some video demos or screenshots of this brick in the wild?
Send them over to [email protected]!


How to Use

You can use this brick to read a data-* attribute from an HTML element. Just provide a selector for the element, and the name after the "data-" prefix

For example, to read the id, you would provide "id" for the attribute:

<div data-id="123456">
  Hello World!
</div>

Inputs

Name Required Type Description
selector string
attribute string The data attribute, without the leading data-. For example: id for data-id

Outputs

Name Required Type Description
No outputs for this brick defined.

Details

ID html/data-attr
Author @todd
Version 1.0.0
Created March 11, 2022
Updated May 26, 2022

Related Bricks