I'm having the same problem as this question but I am using JavaScript, not TypeScript so the solutions there don't apply.
With the following code:
$("input").each(function(i, el) {
console.log(el.value);
});
I get a complaint about el.value:
Unresolved variable value
This is because jQuery type hints el as an HTMLElement but the value property is only present on certain child classes like HTMLInputElement.
The only way I've found to quiet this warning is something like this, which I'm not crazy about doing for the sake of one minor warning (and in certain cases it produces another warning about a "redundant variable"):
$("input").each(function(i, el) {
/** @type {HTMLInputElement} */
const input = el;
console.log(input.value);
});
Is there a cleaner way to deal with this? I did try an inline type definition like this without any luck:
$("input").each(function(i, /** @type {HTMLInputElement} */el) {
console.log(el.value);
});
Here's how each of these looks in the IDE:
