I want to change the color of the li as red on mouse over. And keep the same color in click event also. I have the following list,
Use css for that:
li:hover { color:red; }
And this is not recommended:
li:focus { color: red; }
JQuery
$('li').click(function(){ $(this).css('color','red'); });