Frame.select() 方法
¥Frame.select() method
在第一个 <select>
元素上选择与 selector
匹配的一组值。
¥Selects a set of value on the first <select>
element that matches the selector
.
签名
¥Signature
class Frame {
select(selector: string, ...values: string[]): Promise<string[]>;
}
参数
¥Parameters
范围 | 类型 | 描述 |
---|---|---|
selector | string | 要查询的选择器。 |
values | string[] | 要选择的值的数组。如果 |
Returns:
Promise<string[]>
成功选择的值的列表。
¥the list of values that were successfully selected.
异常
¥Exceptions
如果没有 <select>
与 selector
匹配,则抛出异常。
¥Throws if there's no <select>
matching selector
.
示例
¥Example
frame.select('select#colors', 'blue'); // single selection
frame.select('select#colors', 'red', 'green', 'blue'); // multiple selections