// ⭐️ elem.showDataAttr('data-xxx')
// show element's "data-xxx" attribute & property
Element.prototype.showDataAttr = function (dataAttr){
const prop = dataAttr.toDatasetPropName();
log(`${this.nodeName.toLowerCase()}.${prop} = '${this.dataset[prop]}'`);
log(`${dataAttr}='${this.attr(dataAttr)}'`);
}
// sample result:
// -----------------------
// div.widgetName = 'menu'
// data-widget-name='menu'
Element ⟩ .attr() - get element's attribute