To get the values of data attributes in JavaScript, we use the dataset
property of the element.
For instance, we write
const id = document.querySelector("html").dataset.pbUserId;
to select the html element with querySelector
.
And then we use the dataset
property to get the value of the data-pbUserId
attribute of the element.