Check the current matched set of elements against a selector, element, or function.
const isChecked = $('input[type="checkbox"]').is(':checked');
true // if at least one checkbox is checked
// <div id="box" style="display:none"></div>
const isVisible = $('#box').is(':visible');
false
const hasLongText = $('p').is(function(index) {
return this.textContent.length > 100;
});
true // if matched logic
| Parameter | Type | Description |
|---|---|---|
| selector | string | function | element | SR | A selector expression, a function, a DOM element, or an SR object to match against. |
Returns: Boolean.