function textRed(classname) {
$(classname).hover(
function () {
$(this).css('color','red')
},
function () {
$(this).css('color','#777777')
}
)
}
textRed('nav a');
误区:不能在$(”)中传入形参