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

javascript:newnbsp;Option(text,nbsp;value),我想知道Option的构造函数是什么样的,有多少个参数,参数的作用是什么,还我怎么样... javascript:newnbsp;Option(text,nbsp;value),我想知道Option的构造函数是什么样的,有多少个参数,参数的作用是什么,还我怎么样查看其它对象的构造函数和参数作用的信息?哪位大师能指点一二?nbsp;nbsp;nbsp;nbsp;谢谢…… 展开
 我来答
清风5157
2019-09-07 · TA获得超过620个赞
知道小有建树答主
回答量:372
采纳率:75%
帮助的人:169万
展开全部
JavaScript中的option的构造器 :
new Option(text,value,defaultSelected,selected)
参数含义如下 :
text:字符串,指定option对象的text属性(即<option></option>之间的文字)
value:字符串,指定option对象的value属性
defaultSelected:布尔值,指定option对象的defaultSelected属性
selected:布尔值,指定option对象的selected属性
匿名用户
2013-12-17
展开全部
OptionAnnbsp;optionnbsp;innbsp;anbsp;selectionnbsp;list.nbsp;客户端对象nbsp;nbsp;nbsp;实现版本nbsp;nbsp;Navigatornbsp;2.0Navigatornbsp;3.0:nbsp;添加了nbsp;defaultSelectednbsp;属性;nbsp;textnbsp;属性nbsp;cannbsp;benbsp;changednbsp;tonbsp;changenbsp;thenbsp;textnbsp;ofnbsp;annbsp;optionnbsp;nbsp;创建源Thenbsp;Optionnbsp;constructornbsp;ornbsp;thenbsp;HTMLnbsp;OPTIONnbsp;tag.nbsp;Tonbsp;createnbsp;annbsp;Optionnbsp;objectnbsp;withnbsp;itsnbsp;constructor:nbsp;newnbsp;Option(text,nbsp;value,nbsp;defaultSelected,nbsp;selected)nbsp;Oncenbsp;you‘venbsp;creatednbsp;annbsp;Optionnbsp;object,nbsp;younbsp;cannbsp;addnbsp;itnbsp;tonbsp;anbsp;selectionnbsp;listnbsp;usingnbsp;thenbsp;Select.optionsnbsp;array.nbsp;参数textnbsp;nbsp;(Optional)nbsp;Specifiesnbsp;thenbsp;textnbsp;tonbsp;displaynbsp;innbsp;thenbsp;selectnbsp;list.nbsp;nbsp;valuenbsp;nbsp;(Optional)nbsp;Specifiesnbsp;anbsp;valuenbsp;thatnbsp;isnbsp;returnednbsp;tonbsp;thenbsp;servernbsp;whennbsp;thenbsp;optionnbsp;isnbsp;selectednbsp;andnbsp;thenbsp;formnbsp;isnbsp;submitted.nbsp;nbsp;defaultSelectednbsp;nbsp;(Optional)nbsp;Specifiesnbsp;whethernbsp;thenbsp;optionnbsp;isnbsp;initiallynbsp;selectednbsp;(truenbsp;ornbsp;false).nbsp;nbsp;selectednbsp;nbsp;(Optional)nbsp;Specifiesnbsp;thenbsp;currentnbsp;selectionnbsp;statenbsp;ofnbsp;thenbsp;optionnbsp;(truenbsp;ornbsp;false).nbsp;nbsp;属性概览defaultSelectednbsp;nbsp;Specifiesnbsp;thenbsp;initialnbsp;selectionnbsp;statenbsp;ofnbsp;thenbsp;optionnbsp;nbsp;selectednbsp;nbsp;Specifiesnbsp;thenbsp;currentnbsp;selectionnbsp;statenbsp;ofnbsp;thenbsp;optionnbsp;nbsp;textnbsp;nbsp;Specifiesnbsp;thenbsp;textnbsp;fornbsp;thenbsp;optionnbsp;nbsp;valuenbsp;nbsp;Specifiesnbsp;thenbsp;valuenbsp;thatnbsp;isnbsp;returnednbsp;tonbsp;thenbsp;servernbsp;whennbsp;thenbsp;optionnbsp;isnbsp;selectednbsp;andnbsp;thenbsp;formnbsp;isnbsp;submittednbsp;nbsp;描述Usuallynbsp;younbsp;worknbsp;withnbsp;Optionnbsp;objectsnbsp;innbsp;thenbsp;contextnbsp;ofnbsp;anbsp;selectionnbsp;listnbsp;(anbsp;Selectnbsp;object).nbsp;Whennbsp;JavaScriptnbsp;createsnbsp;anbsp;Selectnbsp;objectnbsp;fornbsp;eachnbsp;SELECTnbsp;tagnbsp;innbsp;thenbsp;document,nbsp;itnbsp;createsnbsp;Optionnbsp;objectsnbsp;fornbsp;thenbsp;OPTIONnbsp;tagsnbsp;insidenbsp;thenbsp;SELECTnbsp;tagnbsp;andnbsp;putsnbsp;thosenbsp;objectsnbsp;innbsp;thenbsp;optionsnbsp;arraynbsp;ofnbsp;thenbsp;Selectnbsp;object.nbsp;Innbsp;addition,nbsp;younbsp;cannbsp;createnbsp;newnbsp;optionsnbsp;usingnbsp;thenbsp;Optionnbsp;constructornbsp;andnbsp;addnbsp;thosenbsp;tonbsp;anbsp;selectionnbsp;list.nbsp;Afternbsp;younbsp;createnbsp;annbsp;optionnbsp;andnbsp;addnbsp;itnbsp;tonbsp;thenbsp;Selectnbsp;object,nbsp;younbsp;mustnbsp;refreshnbsp;thenbsp;documentnbsp;bynbsp;usingnbsp;history.go(0).nbsp;Thisnbsp;statementnbsp;mustnbsp;benbsp;last.nbsp;Whennbsp;thenbsp;documentnbsp;reloads,nbsp;variablesnbsp;arenbsp;lostnbsp;ifnbsp;notnbsp;savednbsp;innbsp;cookiesnbsp;ornbsp;formnbsp;elementnbsp;values.nbsp;Younbsp;cannbsp;usenbsp;thenbsp;Option.selectednbsp;and
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式