回家吃饭了详参 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>

解决方案 »

  1.   

    谢谢yixianggao,不过理解错了我的意思,你那样创建出来就是listbox,不是下拉的,它太占地方了,.
      

  2.   

    var select=document.createElement("select");
    select.multiple =false/true;
    true是列表状,false是下来状
      

  3.   

    select.multiple =false/true;是设置可不可以多选吧??
          window.onload=function()
          {
            var oListBox=document.createElement("select");
           // oListBox.setAttribute("size",1);
            document.body.appendChild(oListBox);
          }
    这样默认就是DropDownList,不行你就设置size属性=1;
      

  4.   

    ture or false都是列表状的,我试了好多次了.
      

  5.   

    去掉oSel.multiple = true;这句话,就是下拉框!
      

  6.   

    去掉oSel.multiple = true;这句话,就是下拉框!