Advertisement
trentjs

data attribute by ID

Oct 20th, 2020
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // GET DATA ATTRIBUTE BY ID
  2. var thisIdSrc = document.getElementById("idName")
  3. var thisTarget = thisIdSrc.getAttribute("data-info");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement