Good afternoon, I would like you to help me since I have to change the property of an input with Angular, I have found a lot with java script but not with angular: I have done the following:
let pass=document.getElementById('password');
With this line I get the element of the Dom, but when I want to change the pass.type property, nothing comes out and it throws me an error that this property does not exist, I hope you can help me.
app.html
app.ts
stack blitz example
I think the error you mention is Property 'type' does not exist on type 'HTMLElement'. That's because typescript by default creates a type object
HTMLElement
and that doesn't have thetype
. If it is declared as a typeany
there is no problem.