I want to use onclick and mouseover in my website but when I tried onclick it won't work. I want to change the background color of my text on click but it change instantly to its previous color.
Here is my html:
<a id="a" class="a" href="bereka.html" onclick="myFunction()">HOME </a>
Here is my css class for a
:
.a
{
font-size:20px;
color:#FFF;
text-align:center;
text-decoration:blink;
padding-right:20px;
}
And below is my script with id
a
function myFunction() {
document.getElementById("a").style.backgoundcolor = "#000";
}