03-27-2023 01:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

Jogger
6
0
7
03-27-2023 01:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Hey guys,
Is it possible to add a data-attribute to a button and retrieve that value? Something like:
```
<use id="btn1" data-value="hello" href="#icon-button" class="large-button application-fill plus-button" />
btn1.addEventListener("click", (evt) => {
console.log(this.value); // should print "hello"
});
```
Thanks in advance! 🙂
```
Thanks in advance! 🙂
1 REPLY 1
03-27-2023 12:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


Veteran Runner
2527
407
1032
03-27-2023 12:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I would find this useful. Could I suggest that post your suggestion here too?
Peter McLennan
Gondwana Software
Gondwana Software

