Highlight: size property

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

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

{{APIRef("CSS Custom Highlight API")}}

The **size** property returns the number of {{domxref("AbstractRange")}} objects in a {{domxref("Highlight")}} object.

Value

The value of size is a read-only integer representing how many entries the highlight object has.

Examples

Using size

js
const highlight = new Highlight();
highlight.add(range1);
highlight.add(range2);
highlight.add(range3);

console.log(highlight.size); // 3

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("css_custom_highlight_api", "The CSS Custom Highlight API", "", "nocode")}}
  • CSS Custom Highlight API: The Future of Highlighting Text Ranges on the Web