I am doing styling using module css and I wonder how I can access to an element with document.querySelector. It seems when I use module css, classname of an element is hashed so I can not access to the element by simply using document.querySelector('.some-classname'). I am not using any framework here so I can not use useRef.
When selecting an element by classNames you are getting an array of the elements even if the class name is only used one time.
Gives you the array of elements:
const elements = document.getElementsByClassName('className');
If you only have one element with this class you can style it like this:
elements[0].style.backgroundColor = "green";