Thanks for sharing this.. it would help me a lot.
Thanks for highlighting the importance of readability in code! Great article too :)
I use a different approach with a js prefix class. Attributes should be used to pass data and not for targeting element even so it's better than targeting an ID or a CSS class.
e.g:
<button class="js-percentage-button btn-red">%</button>
const percentageButton = document.querySelector('.js-percentage-button')
Thanks for sharing, I recently ran into an issue where I had to change my class name in both my HTMl and JS file. Now I'll use the data- attribute instead.
Also I like the way you write π, easily to understand π
Very interesting topic, But don't you think that just by adding another class name only for JavaScript selector, give you the same approach?, thanks.
Wow, amazing content and representations as well. I was feeling like you're talking when you used "not convinced Ayush"
Catalin Pit
Great article!
P.S: I also love the article image!