Articles

0

Like

TypeScript: cast HTMLElement - using function document.getElementsByTagName()

(http://idreesdotnet.blogspot.com/2016/03/typescript-cast-htmlelement-using.html)
Function document.getElementsByTagName() returns NodeListOf<Element>, Where Element is more generic type extends from type Node. Since TypeScript used lib.d.ts declaration file to recognize native javascript functions and properties, you can find this function's multiple signatures in lib.d.ts with different tag names, each have different return type. For example, document.getElementsByTagName("h1") will return NodeListOf<HTMLHeadingElement>.
Posted by: Muhammad Idrees
On 09 Mar 2016 | Views: 591 | Categories: Visual Studio, Tips & Tricks, Other, ASP.NET
Comments(0)

Post your comments

 

Other lins

.Net Techies
Other lins