I have this code
html
<div id="addQuesion">
<ul id="aQul">
<li class="aQli"></li>
<li class="aQli"></li>
</ul>
</div>
and my jQuery is
jQuery
$(document).ready(function(){
$(".aQli").mouseover(function(){
});
$(".aQli").mouseout(function(){
});
});
I want when hovering over a li, the background should be red, and on exit from that li, the background should return to white. How can I do this?
Do you have to use jQuery?
The more “correct” way would be to add a hover style to your class.
See here for an example. http://jsfiddle.net/maurice_butler/5q6QM/