isSelected

Return true or false if an <option> element, or an <input> element of type checkbox or radio is currently selected found by given selector.

Usage

1
client.isSelected(selector).then(callback);

Parameters

Param Type Details
selector String option element or input of type checkbox or radio

Example

index.html
1
2
3
4
5
<select name="selectbox" id="selectbox">
<option value="John Doe">John Doe</option>
<option value="Layla Terry" selected="selected">Layla Terry</option>
<option value="Bill Gilbert">Bill Gilbert"</option>
</select>
isSelected.js
1
2
3
client.isSelected('[value="Layla Terry"]').then(function(isSelected) {
console.log(isSelected); // outputs: true
});

Uses