It works very well when capturing IDs But the problem is that it cannot fetch more than one data. Thats why i want to use querySelectorAll() method.
const titleHoverImageUrl = document.getElementById("toggle").getAttribute("data-image");
console.log(titleHoverImageUrl);
But when i'm holding the class name why it's not working and how can i solve it please kindly tell me.
const titleHoverImageUrl2 = document.querySelectorAll(".toggle").getAttribute("data-image");
console.log(titleHoverImageUrl2);
I want to use many custom attribute values but I can't figure out how to do it Kindly tell me.