Куда и кого надо добавить, о каком data-атрибуте идёт речь:
const containerSelector = '.class-1';
const tag = 'div';
const key = 'name';
const attrSelector = `[data-${key}]`;
Добавляем:
$(containerSelector).prepend(function() {
return $(`<${tag}>`).text($(attrSelector, this).data(key));
});
или
document.querySelectorAll(containerSelector).forEach(n => {
const val = n.querySelector(attrSelector).dataset[key];
// можем добавлять разметку
n.insertAdjacentHTML('afterbegin', `<${tag}>${val}</${tag}>`);
// или элемент
const el = document.createElement(tag);
el.textContent = val;
n.prepend(el);
// или
// n.firstChild.before(el);
// n.insertBefore(el, n.firstChild);
// n.insertAdjacentElement('afterbegin', el);
// n.firstChild.replaceWith(el, n.firstChild);
});