HTML:
<div id="me" data-property-1="1" data-property-2="2" data-property-3="3"></div>
Is it possible to get the lenght of all data-attributes of the div with vanilla.js?
Can you try this:
const dataSetLength = Object.keys(document.getElementById('me').dataset).length;
console.log('Length of dataset:', dataSetLength);
<div id="me" data-property-1="1" data-property-2="2" data-property-3="3"></div>