All the examples i found online didn't work for me. All i want is to change color on text when mouse is on it. And when move mouse to get old color (and maybe to change size, but if that is too complicated not yet) I know how to do that in CSS but i am learning JS and thats the way i would like it. It is only one word in text so it is Class and not ID.
document.getElementsByClassName("akcija").addEventListener("mouseover", mouseOver);
document.getElementsByClassName("akcija").addEventListener("mouseout", mouseOut);
function mouseOver() {
document.getElementsByClassName('akcija').style.color = "black";
}
function mouseOut() {
document.getElementsByClassName('akcija').style.color = "Blue";
}
<div class="akcija" style="width:200px; height:200px"></div>