Hi, on the css I have two classes as follows...
.list_menu a {
display: block;
padding: 12px 0px;
background: #e1e1e1;
text-decoration: none;
}
.list_menu a:hover {
background: #d4d4d4;
background-repeat:no-repeat;
width:100%;
}
I want to remove them both and add my own Selected state when you click my div, I am using the following javascript function when you click, but it doesn't work, am I referencing the classes wrongly? Thanks.
function addMySelectedState()
{
var nameElem1 = document.getElementById("option1");
nameElem1.classList.remove("list_menu a");
nameElem1.classList.remove("list_menu a:hover");
nameElem1.classList.add("list_menu_selected");
}
ASKER