Skip to content

HTMLElement.style defined as readonly when it is mutable #13466

@kg

Description

@kg

TypeScript Version: 2.1.5
Code

var elt = document.createElement("div");
elt.style = "test";

Expected behavior:
Should compile and run

Actual behavior:
Typescript compiler rejects the assignment to style as invalid.
According to MDN this is a valid assignment, and it works in every modern browser. The value returned by .style is readonly, but the property itself is not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions