CSSKeywordValue: value property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{APIRef("CSS Typed Object Model API")}} {{AvailableInWorkers}}

The **value** property of the {{domxref("CSSKeywordValue")}} interface represents the keyword as a string.

Value

A string.

Exceptions

  • {{jsxref("TypeError")}}
  • : Thrown if the value property is set to an empty {{jsxref('String')}}.

Examples

Basic usage

The following example resets the CSS {{cssxref('display')}} property to its defaults.

js
let indicator = document.getElementById("indicator");
indicator.attributeStyleMap.set("display", new CSSKeywordValue("initial"));
indicator.attributeStyleMap.get("display").value; // 'initial'

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}