5
Küçük ekranlarda çöken yanıt veren bir menü çubuğu tasarlamaya çalışıyorum, ancak ben typescript kullanıyorum. Ben typescript bu kodun değiştirildi typescriptÖğe türüne göre sınıf adı nasıl seçilir?
function myFunction() {
document.getElementsByClassName("topnav")[0].classList.toggle("responsive");}
bu kodun ne eşdeğer bir ipucu yoktur ama asla çalışır
typescript javascript bir üst çünkü hiçbir şey değiştirmeye gerek yokturmyFunction(): void {
(<HTMLScriptElement[]><any>document.getElementsByClassName("topnav"))[0].classList.toggle("responsive");
}
Teşekkür @NitzanTomer – kero