javascript:new Option(text, value),我想知道Option的构造函数是什么样的?

来源:百度知道 编辑:UC知道 时间:2024/06/03 12:39:27
javascript:new Option(text, value),我想知道Option的构造函数是什么样的,有多少个参数,参数的作用是什么,还我怎么样查看其它对象的构造函数和参数作用的信息?

哪位大师能指点一二?
谢谢……

Option
An option in a selection list.
客户端对象
实现版本 Navigator 2.0
Navigator 3.0: 添加了 defaultSelected 属性; text 属性 can be changed to change the text of an option

创建源
The Option constructor or the HTML OPTION tag. To create an Option object with its constructor:
new Option(text, value, defaultSelected, selected) Once you've created an Option object, you can add it to a selection list using the Select.options array.

参数
text (Optional) Specifies the text to display in the select list.
value (Optional) Specifies a value that is returned to the server when the option is selected and the form is submitted.
defaultSelected (Optional) Specifies whether the option is initially selected (true or false).
selected (Optional) Specifies the current selection state of the option (true or false).

属性概览
defaultSelected Specifies the initial selection state of the option
selected Specif