Select specific list item in an unordered list

Select specific list item in an unordered list

I have a menu which is generated dynamically, and I want to create a hover effect on the buttons by adding a class.

I tried this:

$(function() {
   
    $("li[a:contains('Home')]").addClass("Home");
    $("li[a:contains('About')]").addClass("About");
    $("li[a:contains('Contact')]").addClass("Contact");
    $("li[a:contains('Admin')]").addClass("Admin");

});


The classes are not added when I look at the source...

I tried adding a class to the ul itself, just to make sure I had set things up correctly...
$("#Nav").addClass("blabla");

That works fine...

Any ideas?