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,
<html>
<body>
<ul>
<li>list1</li>
<li>list2
<ul>
<li>sublist1</li>
<li>sublist2</li>
<li>sublist3</li>
<li>sublist4</li>
</ul>
</li>
<li>list3</li>
<li>list4</li>
</ul>
</body>
</html>
list1
list2
sublist1
sublist2
sublist3
sublist4
list3
list4
If i click the list1, it color should be change into red, at the same time if i mouse over the other list it will be displayed as red. Its default color is black.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…