0
I’m having trouble trying to get the value of an input to clear it, the code is in a script . ts (used in Angular 7), code below:
document.querySelector('.input').value = "";
Error while compiling code
error TS2339: Property 'value' does not exist on type 'Element'
Is something missing? Because I did tests using the console and everything went right.
The best would be to take from your Ngmodel or your Reactiveforms depending on which you are using. This taking input value through Dom was old jquery practice and is not recommended mainly with angular.
– Eduardo Vargas
I’ll look into Ngmodel and Reactiveforms, thank you!
– Sabrina