trying to select all radio input and their checked status using below code
const radioInput = document.querySelectorAll("input[type=radio]");
radioInput.forEach((r) => (r.checked = r.defaultValue === 'whatever'));
this is working in javascript but now trying to convert into typsscript and now it
gives below typing error inside forEach()
Property ‘checked’ does not exist on type ‘Element’.
also when we hover on radioInput variable, its display NodeList<Element>
How can we fix this?
Note: Already checked similar questions, most of answer are React related while my code is on typescript only (.ts, not .tsx)