I am trying to design responsive menu bar that collapses in small screens, however, I am using typescript. is there any clue what equivalent to this code in typescript
function myFunction() {
document.getElementsByClassName("topnav")[0].classList.toggle("responsive");}
I changed to this code in typescript but it never works
myFunction(): void {
(<HTMLScriptElement[]><any>document.getElementsByClassName("topnav"))[0].classList.toggle("responsive");
}