0

I am using Typescript in my application. I want to clear the dropdown list values.

Typescript:-

  let myContainer = document.getElementById('date') as HTMLInputElement;
  myContainer.value = "";

By using the above code, I can able to clear the dropdown list value. But I cannot able to clear the value selected in the dropdown popup. How to achieve that in typescript?

Nivitha G
  • 243
  • 3
  • 7
  • 17
  • Do you want to clear a `select` list or and `input` because you are declaring `myContainer as HTMLInputElement`? In any other case, you do it the same way as with JavaScript https://stackoverflow.com/questions/3364493/how-do-i-clear-all-options-in-a-dropdown-box – DrColossos Aug 17 '17 at 07:37
  • This has nothing to do with TypeScript. You can't clear a dropdown list (assuming you mean a plain old HTML ` –  Aug 17 '17 at 12:43

0 Answers0