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)
| 归档时间: |
|
| 查看次数: |
5533 次 |
| 最近记录: |