for some reason, I cannot change the text of a span
This is the span in html
<span id="sortingText"></span>
This is the span being called within typescript
sortingText : any = document.getElementById("sortingText");
And this is the method where I am changing the value
this.sortingText.textContent = "Sorting by Descending";
However when I try this, I get "ERROR TypeError: Cannot set property 'textContent' of null" What am I doing wrong?