I am trying to change the property of background color on mouseover of the nav ul li element but when I select another element of the same kind I want the first one to revert its color and the newly selected to change color and so on.
$(document).ready(function() {
$('nav ul li').on('mouseover', function() {
if ($(this).css('background-color') == '#BBB') {
$(this).css("background-color", "#36D900");
} else {
$(this).css("background-color", "#BBB");
}
});
});