Answers for "get data attribute react"

3

event target data atributes

event.target.getAttribute("data-sortorder");
Posted by: Guest on October-15-2020
3

react data attributes event

const removeId = e.target.getAttribute("data-remove");
Posted by: Guest on August-31-2020
0

react get data attribute from element

<div data-id={someId} >Test</div>

const id = e.target.getAttribute("data-id");
//alternate to getAttribute
const id = e.target.attributes.getNamedItem("data-id").value;
Posted by: Guest on February-03-2021

Browse Popular Code Answers by Language