Skip to content

error: Property 'innnerHTML' does not exist on type 'Element' #5754

Description

@am11

I am getting this error with v1.6.3 with the following code:

document.querySelector('body>section.container').innerHTML  // error: TS2339

To remedy it, I had to explicitly cast it as HTMLElement:

(<HTMLElement>document.querySelector('body>section.container')).innerHTML  // it works!

However, innerHTML is supported by Element interface:
https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do thisSuggestionAn idea for TypeScript

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions