Let's say i have a HTML element as following:
<progress value="1" max="10" id="site_progress"></progress>
VSCode shows a problem ('Property "max" does not exist on type "Element"'), if i select this element like this:
const progress = document.querySelector('#site_progress');
progress.max = 9;
There will be no problems, if i select via element selector:
const progress = document.querySelector('progress');
progress.max = 9;
Can i do something like type assertion to avoid this kind of behavior or what are good practises to handle this problem in regular javascript?