const attrName = 'bst-click';
const elements = document.querySelectorAll(`[${attrName}]`);
const data = Array.from(
elements,
n => [
n.attributes[attrName].value,
n.classList.value,
]
);
const data = Array.prototype.reduce.call(
elements,
(acc, n) => (
(acc[n.getAttribute(attrName)] ??= []).push(n.className),
acc
),
{}
);