I am using typescript in my application.
html code:
<input type="text" name="lastname" id="last">
let myContainer = <HTMLElement>document.getElementById('last');
myContainer.innerHTML = "";
document.getElementById('last').innerHTML = "";
Html input elements have the value property, so it should be:
let myContainer = document.getElementById('last') as HTMLInputElement;
myContainer.value = "";
Notice that I also used HTMLInputElement
instead of HTMLElement
which does not have the value
property.