tho*_*rn̈ 12
$yourJqueryObject.is(yourDomElement)
Run Code Online (Sandbox Code Playgroud)
请参阅1.6中添加的.is().
类似于Gumbos的答案,但更苗条:
if ( obj.filter(function() { return this == el; }).length ) {
// obj contains el
}
Run Code Online (Sandbox Code Playgroud)