I attempted to change the style of an element using JavaScript within my TypeScript code, but unfortunately it is not working as expected. Here is the approach I took:
const element = document.getElementsByClassName('current');
element.style.backgroundColor = "" + this.styles.style.mainIdentifyingColor;
However, I encountered the following error:
The property 'style' does not exist on HTMLCollectionOf.
I also experimented with using setAttribute instead, but faced the same issue.