I have background image installed in css:
.indicator {
grid-area: b;
background-color: yellow;
background-image: url(./maxresdefault.jpg);
}
and want to change it on event like that:
indicator.oncontextmenu = function() {
indicator.style.background = '';
alert('msg');
}
but have no clue which type of command is used to change the background image in css by js. how do i change it?
element.classList.add('newclass');also see stackoverflow.com/questions/66286619/…