zm_sansan,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
.lightblue {
background: lightblue;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
$(function() {
$(".a:not(:has(>.a))").on('mouseenter mouseleave', function(event) {
$(this).toggleClass('lightblue', event.type == 'mouseenter')
});
});
</script>
</head>
<body>
<div class='a'> 1
<div class='a'> 2 </div>
<div class='a'> 3
<div class='a'> 4 </div>
</div>
</div>
</body>
</html>