Here is the element:
<button class="nos" id="nos1" onClick="nos(0)"></button> In css, write the property when you click to change the background:
#nos1:active{background-position: -118 -27;} Then in js we replace the background by ourselves:
documet.getElementById('nos1').style.backgroundPosition = "-59 -27" The code from css stops working (the button does not change when pressed). Why is this happening? Is there a way to set the pseudo-class not through html, but in js (that is, through js to influence the style when pressed)?