CSSStyleDeclaration

Обновлено: 09.03.2023

Об’єкт CSSStyleDeclaration

Об’єкт CSSStyleDeclaration представляє набір пар властивість-значення CSS.

Властивості та методи об’єкта CSSStyleDeclaration

  • cssText

    cssText

    Sets or returns the textual representation of a CSS declaration block

  • length

    length

    Returns the number of style declarations in a CSS declaration block

  • parentRule

    parentRule

    Returns a CSS rule that is the parent of the style block

  • getPropertyPriority()

    getPropertyPriority()

    Returns whether or not the specified CSS property has the "important!" priority set

  • getPropertyValue()

    getPropertyValue()

    Returns the value of the specified CSS property

  • item()

    item()

    Returns the CSS property name from a CSS declaration block, by index

  • removeProperty()

    removeProperty()

    Removes a CSS property from a CSS declaration block

  • setProperty()

    setProperty()

    Sets a new or modifies an existing CSS property in a CSS declaration block