TypeScript: casting HTMLElement

后端 未结 13 2102
我寻月下人不归
我寻月下人不归 2020-12-02 05:34

Does anyone know how to cast in TypeScript?

I\'m trying to do this:

var script:HTMLScriptElement = document.getElementsByName(\"script\")[0];
alert(s         


        
相关标签:
13条回答
  • 2020-12-02 05:55
    var script = (<HTMLScriptElement[]><any>document.getElementsByName(id))[0];    
    
    0 讨论(0)
提交回复
热议问题