2009-08-19 58 views

回答

4

使用jQuery hasClass

if($("#test").hasClass("target2")) 
{ 
    // yep, it has... 
} 
0

你真的想知道的還是你想要做的事,如果有?

在後一種情況下,這將很好地做:

$("#test.target2").doWhateverYouWantToDo(...); 
相關問題