Using Angular 4 (typescript), I have the below HTML code:
<div *ngIf="dataService.selected_markers.length == 0" id="tsnPasteContainer">
<form style="width: 100%; height: 100%">
<textarea id="tsn_list" style="width: 100%; height: 100%" type="text" name="tsn_list" placeholder="e.g. 2001311,2425302,2153542,2435974"></textarea>
</form>
</div>
I am trying to get the data that the user is typing into the textarea using:
public parseTSNs(){
let tsnString = document.getElementById("tsn_list").value;
console.log("User inputted string: " + tsnString);
}
This function is called by a button.
The code is not compiling due to:
Property 'value' does not exist on type 'HTMLElement'
This should be a simple function. What am I doing wrong? W3schools "getting values from textarea" shows '.value' as the required function!