$(this).find('a');
This will find the <a>
element inside the <li>
element.
Even better:
$('li a').mouseover(function () {
var a = $(this); // this now refers to <a>
a.css('color', 'white');
});
Using the selector wisely you can save time by avoiding additional function calls.
Even better, use only a single event listener for the mouse over event, in the parent <ul>
tag.
$('ul').mouseover(function (e) {
var a = $(e.target); // e.target is the element which fired the event
a.css('color', 'white');
});
This will save resources since you only use a single event listener instead of one for each <li>
elements.