document.getElementById("divId").getAttribute("attributeId");
document.querySelector("div[data-automation='something']")
Select element by custom attribute
<!-- TRYING TO ACCESS TO CUSTOM ATTRIBUTES WITH JAVASCRIPT ? -->
<article
id="electric-cars"
data-columns="3"
data-index-number="12314"
data-parent="cars">
</article>
<script>
// const article = document.getElementById("electric-cars")
article.dataset.columns // "3"
article.dataset.indexNumber // "12314"
article.dataset.parent // "cars"
</script>