0
這工作:傳遞一個變量jQuery選擇
function rowColors(){
$("table#remotes th").css("background-color", "#202020");
$("table#remotes tr").css("background-color", "#484848");
$("table#remotes tr:visible:odd").css("background-color", "#333333");
}
我怎樣才能讓一個變量表ID這項工作?這是行不通的:
function rowColors(tblid){
$("table#"+tblid+" th").css("background-color", "#202020");
$("table#"+tblid+" tr").css("background-color", "#484848");
$("table#"+tblid+" tr:visible:odd").css("background-color", "#333333");
}
rowColors(remotes);
是啊,這是值得一提此無關的jQuery明確。 – naomik 2014-08-29 19:37:58