You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionhi(){letlink=<HTMLAnchorElement>document.querySelector("#link");link.onclick=function(e:Event){this.href="http://www.typescript.com";//href not exists as property}}
Expected behavior:
this inside link.onclick function should be a HTMLAnchorElement but it is not.
Actual behavior:
this is not a HTMLAnchorElement so I don't can to access to properties of a link as "href"
The text was updated successfully, but these errors were encountered:
TypeScript Version: 2.1.4
Code
Expected behavior:
this
inside link.onclick function should be a HTMLAnchorElement but it is not.Actual behavior:
this
is not a HTMLAnchorElement so I don't can to access to properties of a link as "href"The text was updated successfully, but these errors were encountered: