2014-12-07 52 views
-1

我想做某事是這樣的:子元素的這個jQuery

$(".game-cover").mouseenter(function() { 
    $($(this)+" :input").css("background-color", "#A2D205"); 
}); 

但我不知道如何與結合elemnt :輸入。有人能幫助我嗎?

回答

2

你可以使用jQuery.find找到這也接受一個選擇器的後代,你的情況:input

$(".game-cover").mouseenter(function() { 
    $(this).find(":input").css("background-color", "#A2D205"); 
});