So I got my script with the DOM: HTML and JS When I hoover cursor over one of the given blocks it changes text color in all of them. Here's the CSS: CSS And I wanted to make it change color also on the background of the buttons. But I don't know how to get "inside" this "h3::after".
function kolor(color) {
document.getElementsByTagName('body')[0].style.color = color;
document.getElementsByTagName('h3')[0].style.h3::after.bgColor = color;
}
<h3 onmouseover="kolor('#c90000');">Red</h3>
<h3 onmouseover="kolor('#008BCC');">Blue</h3>
<h3 onmouseover="kolor('#fedf00');">Yellow</h3>