Back to Content

CSSUnparsedValue: length property

files/en-us/web/api/cssunparsedvalue/length/index.md

latest908 B
Original Source

{{APIRef("CSS Typed OM")}}

The length read-only property of the {{domxref("CSSUnparsedValue")}} interface returns the number of items in the object.

Value

An integer.

Examples

In this example we employ the {{domxref("CSSUnparsedValue.CSSUnparsedValue", "CSSUnparsedValue()")}} constructor, then query the length:

js
const values = new CSSUnparsedValue(["1em", "#445566", "-45px"]);

console.log(values.length); // 3

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("CSSUnparsedValue.CSSUnparsedValue", "CSSUnparsedValue()")}}
  • {{domxref("CSSUnparsedValue.entries")}}
  • {{domxref("CSSUnparsedValue.forEach")}}
  • {{domxref("CSSUnparsedValue.keys")}}
  • {{domxref("CSSUnparsedValue.values")}}
  • Using the CSS Typed OM
  • CSS Typed Object Model API