Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to get the value of an input in typescript

const input = document.getElementById('input') as HTMLInputElement;

function getValue(){
  let value = input.value;
}
// then you apply this function to a button element in the HTML doc
// <button onclick="getValue()">Get value</button>
 
PREVIOUS NEXT
Tagged: #input #typescript
ADD COMMENT
Topic
Name
5+2 =