seclObj.appendChild(new Option(x[i],i+1));要加什么才会在点击时出现
01 02 03这样的下拉名单 
这个句子还不完善,还要加一些东西,但是不知道怎么加
<script language="javascript">
var img="1.jpg|2.jpg|3.jpg";
x=img.split("|");
z=x.length-1;
window.onload=function(){
    var seclObj=document.getElementById("secl");
    seclObj.onchange=function(){
        document.all.cc.value=this.value-1;
        document.all.ima.src=x[this.value-1];
    }
    for(var i=0;i<=z;i++){
        seclObj.appendChild(new Option(x[i],i+1));
    }
}
........................................</script>
<body>
<img src="1.jpg" name="ima">
<input type="hidden" name="cc" id="cc" value="0">
<br/>
<input type="button" onclick="prev()" value="上一页">
<input type="button" onclick="next()" value="下一页">
<select id="secl"></select>
</body>
</html>

解决方案 »

  1.   

    appendChild 不兼容 IE FF
      

  2.   

    哇塞,你又发个帖子。
    其实只要把创建option的代码改成通用的就可以了。
    window.onload=function(){
        var seclObj=document.getElementById("secl");
        seclObj.onchange=function(){
            document.all.cc.value=this.value-1;
            document.all.ima.src=x[this.value-1];
        }
        for(var i=0;i<=z;i++){
    var tempOption=document.createElement("option");
    tempOption.value=i+1;
    tempOption.appendChild(document.createTextNode(x[i]))
            seclObj.appendChild(tempOption);
        }
    }
      

  3.   

    空白是因为有很多option的值为空
    ---------------------------------------------------------------------------------------------
    http://www.jiemengwu.com/ 解梦屋 http://www.phpzy.com/php/ 绿色php资源http://www.shopfw.com网店服务
      

  4.   

    不是appendChild的问题,是那个new Option的问题
      

  5.   

    哇塞,你又发个帖子。
    其实只要把创建option的代码改成通用的就可以了。
     
    hackerster0324
     +++++++++
    你还好说,谁叫你一开始没把该写的写完