MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / isSelected

Function isSelected

javascript/atoms/typescript/get-attribute.ts:117–126  ·  view source on GitHub ↗
(element: Element)

Source from the content-addressed store, hash-verified

115 }
116
117 function isSelected(element: Element): boolean {
118 if (isElement(element, 'OPTION')) {
119 return (element as HTMLOptionElement).selected;
120 }
121 const type = (element as HTMLInputElement).type?.toLowerCase();
122 if (type === 'checkbox' || type === 'radio') {
123 return (element as HTMLInputElement).checked;
124 }
125 return false;
126 }
127
128 function isObject(value: unknown): boolean {
129 return value !== null && (typeof value === 'object' || typeof value === 'function');

Callers 1

getFunction · 0.70

Calls 1

isElementFunction · 0.70

Tested by

no test coverage detected