isEqual
Gibt true zurück, wenn das ausgewählte Element mit dem bereitgestellten Element übereinstimmt.
Verwendung
$(selector).isEqual(el)
Parameter
Name | Type | Details |
---|---|---|
el | Element | Element zum Vergleichen |
Beispiel
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
});
Rückgabewert
- <Boolean>
return
: true wenn Elemente gleich sind