isEqual
如果选择的元素与提供的元素匹配,则返回true。
用法
$(selector).isEqual(el)
参数
名称 | 类型 | 详情 |
---|---|---|
el | Element | 用于比较的元素 |
示例
isEqual.js
it('should detect if an element is clickable', async () => {
const el = await $('#el')
const sameEl = await $('#el')
const anotherEl = await $('#anotherEl')
el.isEqual(sameEl) // outputs: true
el.isEqual(anotherEl) // outputs: false
});
返回值
- <Boolean>
return
: 如果元素相等则返回true