HTMLElement: attributeStyleMap property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The attributeStyleMap
read-only property of the HTMLElement
interface returns a live StylePropertyMap
object that contains a list of style properties of the element that are defined in the element's inline style
attribute, or assigned using the style
property of the HTMLElement
interface via script.
Shorthand properties are expanded. If you set border-top: 1px solid black
, the longhand properties (border-top-color
, border-top-style
, and border-top-width
) are set instead.
The main difference between style
property and attributeStyleMap
property is that, the style
property will return a CSSStyleDeclaration
object, while the attributeStyleMap
property will return a StylePropertyMap
object.
Though the property itself is not writable, you could read and write inline styles through the