回家吃饭了详参 DHTML参考手册
http://download.csdn.net/source/308913L@_@K
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head> <body>
<script type="text/javascript">
<!--
var oSel = document.createElement("select");
oSel.multiple = true;
oSel.size = 6;
oSel.style.width = "150px";
for (var i=0; i<9; i++)
{
oSel.options.add(new Option("选项"+i, i));
}
document.body.appendChild(oSel);
//-->
</script>
</body>
</html>
http://download.csdn.net/source/308913L@_@K
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head> <body>
<script type="text/javascript">
<!--
var oSel = document.createElement("select");
oSel.multiple = true;
oSel.size = 6;
oSel.style.width = "150px";
for (var i=0; i<9; i++)
{
oSel.options.add(new Option("选项"+i, i));
}
document.body.appendChild(oSel);
//-->
</script>
</body>
</html>
select.multiple =false/true;
true是列表状,false是下来状
window.onload=function()
{
var oListBox=document.createElement("select");
// oListBox.setAttribute("size",1);
document.body.appendChild(oListBox);
}
这样默认就是DropDownList,不行你就设置size属性=1;