Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zh-cn]: create doc for HTMLOptionsCollection #23087

Merged
merged 2 commits into from
Aug 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions files/zh-cn/web/api/htmloptionscollection/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: HTMLOptionsCollection
slug: Web/API/HTMLOptionsCollection
l10n:
sourceCommit: 387d0d4d8690c0d2c9db1b85eae28ffea0f3ac1f
---

{{ APIRef("HTML DOM") }}

**`HTMLOptionsCollection`** 接口表示 [`<option>`](/zh-CN/docs/Web/HTML/Element/option) HTML 元素的集合(以文档的顺序),并提供从列表中选择以及可选地更改其项目的方法和属性。此对象仅由 [select](/zh-CN/docs/Web/API/HTMLSelectElement) 的 `options` 属性返回。

{{InheritanceDiagram}}

## 实例属性

- `length`
- : `unsigned long`,正如规范所允许的那样,此属性不是只读的。你可以通过降低该值从末尾删除选项,或者提高该值在末尾添加空白选项。Mozilla 允许这样做,而其它实现可能会抛出 [DOMException](/zh-CN/docs/Web/API/DOMException)。

## 实例方法

_从其父接口 [`HTMLCollection`](/zh-CN/docs/Web/API/HTMLCollection) 继承方法。_

## 规范

{{Specifications}}

## 浏览器兼容性

{{Compat}}

## 参见

- [HTMLCollection](/zh-CN/docs/Web/API/HTMLCollection)