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

Function isSelected

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

Source from the content-addressed store, hash-verified

105 }
106
107 function isSelected(element: Element): boolean {
108 if (isElement(element, 'OPTION')) {
109 return (element as HTMLOptionElement).selected;
110 }
111 const type = (element as HTMLInputElement).type?.toLowerCase();
112 if (type === 'checkbox' || type === 'radio') {
113 return (element as HTMLInputElement).checked;
114 }
115 return false;
116 }
117
118 function isObject(value: unknown): boolean {
119 return value !== null && (typeof value === 'object' || typeof value === 'function');

Callers 1

get-attribute.tsFile · 0.70

Calls 1

isElementFunction · 0.70

Tested by

no test coverage detected