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 اگر عناصر یکسان باشند