网页上填写东西的时候,单击写字的框,出来的下拉菜单怎么来的

王朝知道·作者佚名  2011-05-18
窄屏简体版  字體: |||超大  
 
分類: 電腦/網絡 >> 互聯網
 
問題描述:

我之前没有用过这个网页啊 怎么出来的纪录呢

參考答案:

定义

表示一个列表框或者一个下拉框。

Denotes a list box or drop-down list.

注释

此元素在 Internet Explorer 3.0 及以上版本的 HTML 中可用。

此元素是窗口控件,不支持 z-index 或者 zIndex 属性。

此元素是内嵌元素。

此元素需要关闭标签。

The SELECT element is available in HTML and script, as of Internet Explorer 3.0.

This element is a windowed control and does not support the z-index attribute or zIndex property.

This element is an inline element.

This element requires a closing tag.

示例代码

下面的例子使用 SELECT 元素创建了一个下拉列表框。

This example uses the SELECT element to create a drop-down list box.

<SELECT NAME="Cats" SIZE="1"><OPTION VALUE="1">Calico<OPTION VALUE="2">Tortie<OPTION VALUE="3" SELECTED>Siamese</SELECT>

下面的例子使用 select 元素创建了多项选择列表框,方法是设置了 SIZE 和 MULTIPLE 标签属性。要获得多项选择列表框的选中选项,则须遍历 options 集合并检查 SELECTED 是否被设为 true。

This example uses the select element to create a multi-select list box by setting the SIZE and MULTIPLE attributes. To retrieve the selected options for a multi-select list box, iterate through the options collection and check to see where SELECTED is set to true.

<SELECT ID="oSelect" NAME="Cars" SIZE="3" MULTIPLE><OPTION VALUE="1" SELECTED>BMW<OPTION VALUE="2">Porsche<OPTION VALUE="3" SELECTED>Mercedes</SELECT>

下面的例子在上面创建的 SELECT 列表的底部添加了一个新选项。新选项的构造程序也可在 Microsoft JScript? 中使用。

This example adds a new option to the end of the SELECT list created above. The new Option constructor can also be used in Microsoft JScript.

<SCRIPT LANGUAGE="JScript">var oOption = document.createElement("OPTION");oOption.text="Ferrari";oOption.value="4";oSelect.add(oOption);</SCRIPT>

小贴士:① 若网友所发内容与教科书相悖,请以教科书为准;② 若网友所发内容与科学常识、官方权威机构相悖,请以后者为准;③ 若网友所发内容不正确或者违背公序良俗,右下举报/纠错。
 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航