<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Data Attributes</title>

</head>
<body>
  <!-- Custom data-* attributes let you attach info to any element -->
  <button data-user-id="42" data-role="admin" onclick="show(this)">
    Show my data
  </button>

  <script>
    function show(btn) {
      // Read data attributes via the dataset property
      alert('userId=' + btn.dataset.userId + ', role=' + btn.dataset.role);
    }
  </script>
</body>
</html>