html如何定义一个下拉列表框标签

时间:2012.12.29 发布人:lilei1991411

html如何定义一个下拉列表框标签

已解决问题

谷歌lilei1991411用户在2012.12.29提交了关于“行尸走肉第三季html如何定义一个下拉列表框标签”的提问,欢迎大家涌跃发表自己的观点。目前共有1个回答,最后更新于2025-02-27T06:12:56。希望大家能够帮助她。

详细问题描述及疑问:期待您的答案,当代劳模,所有人都应该向你学习 !

希望以下的回答,能够帮助你。

第1个回答

用户名:liyabin1  

没有那么个属性的置守宣孩看压写只能模拟,下面是个来自例子<scripttype="text/j**ascript">
functionmo与路出useOver(obj){
obj.s问答tyle.backgroundColor='#000080';
o销名她纸航bj.style.color='#FFFFFF';
}
functionmouseOut(obj){
obj.style.backgroundColor='#FFFFFF';
obj.style.color='#000000';
}
varoPopup=window.cre往简atePopup();
functionshowSelect(obj){
varcss="";
css="<styletype=\"text/css\">"+
".selectStyle{"+
"font-size:12数队解消陈波县px;"+
"cur倍面运密资何看sor:pointer;"副底步衣+
"}"+
".bodyStyle{"+
"margin:0px;"+
"border:#0000001pxs沿打茶会极olid;"+
"}"+
"</style>";
varwinstr="";
winstr="<ta定汉云植blewidth=100%>"+
"<tr"+
"o理米些nmouseover=\"育质英联食更压完司心parent.mouseOver(this)\""+
"onmouseout=\"parent.mouseOut(this)\""+
"onclick=\"parent.hideSelect('我是第一个','1')\">"+
"<tdclass=\"selectStyle\">我是第一个</td></tr>"+"<tr"+
"onmouseover=\"parent.mouseOver(this)\""+
"onmouseout=\"parent.mouse乙Out(this械病周简台分而映米陈重)\""+
"onclick=\"parent.hideSelect('我是第二个','2')\">"+
"<tdclass=\"selectStyle\">我是第二个</td></露企首考tr>"+"<tr商强相饭亚回"+
"onmouseo钟养聚识垂标离府突输吃ver=\"parent.mouseOver(this)\""+
"onmouseout=\"parent.mouseOut(this)\""+
"onclick=\"parent.hideSelect('我是第三个','3')\">"+
"<tdclass=\"selectStyle\">我是第三个</td></tr>"+"<tr"+
"onmouseover=\"parent.mouseOver(this)\""+
"onmouseout=\"parent.mouseOut(this)\""+
"onclick=\"parent.hideSelect('我是第四个','4')\">"+
"<tdclass=\"selectStyle\">我是第四个</td></tr>"+"<tr"+
"onmouseover=\"parent.mouseOver(this)\""+
"onmouseout=\"parent.mouseOut(this)\""+
"onclick=\"parent.hideSelect('我是第五个','5')\">"+
"<tdclass=\"selectStyle\">我是第五个</td></tr>"+"<tr"+
"onmouseover=\"parent.mouseOver(this)\""+
"onmouseout=\"parent.mouseOut(this)\""+
"onclick=\"parent.hideSelect('我是第六个','6')\">"+
"<tdclass=\"selectStyle\">我是第六个</td></tr>"+"<tr"+
"onmouseover=\"parent.mouseOver(this)\""+
"onmouseout=\"parent.mouseOut(this)\""+
"onclick=\"parent.hideSelect('我是第七个','7')\">"+
"<tdclass=\"selectStyle\">我是第七个</td></tr>"+"<tr"+
"onmouseover=\"parent.mouseOver(this)\""+
"onmouseout=\"parent.mouseOut(this)\""+
"onclick=\"parent.hideSelect('我是第八个','8')\">"+
"<tdclass=\"selectStyle\">我是第八个</td></tr>"+"<tr"+
"onmouseover=\"parent.mouseOver(this)\""+
"onmouseout=\"parent.mouseOut(this)\""+
"onclick=\"parent.hideSelect('我是第九个','9')\">"+
"<tdclass=\"selectStyle\">我是第九个</td></tr>"+"<tr"+
"onmouseover=\"parent.mouseOver(this)\""+
"onmouseout=\"parent.mouseOut(this)\""+
"onclick=\"parent.hideSelect('我是第十个','10')\">"+
"<tdclass=\"selectStyle\">我是第十个</td></tr>"+"</table>";
oPopup.document.body.innerh**TML="";
oPopup.document.write("<bodyclass=\"bodyStyle\"scrolling=\"auto\">");
oPopup.document.write(css);
oPopup.document.write(winstr);
oPopup.document.write("</body>");
//obj.offsetWidth为宽度,可以使用常数代替;
//5为点击下拉列表时默认显示5项,
//字体默认大小为12px,请根据字体大小修改数字18
***.show(0,obj.clienth**eight,obj.offsetWidth,5*18,obj);
}
functionhideSelect(name,value){
varobj=document.getElementById("test");
obj.options.length=0;
obj.options.add(newOption(name,value));
oPopup.hide();
}
</script>
<center>
<h1>可调高度的下拉列表</h1>
<hr>
<selectid="test"style="width:150px"onclick="showSelect(this)">
<option>--请选择--</option>
</select>
</center>