http://community.csdn.net/Expert/topic/5111/5111400.xml?temp=.6124689
look here!

解决方案 »

  1.   

    简单些
    <td width=50>
    <div onclick="this.style.display='none';nextSibling.style.display=''">...</div
    ><select id=s style="display:none;width:100%;height:20px" onchange="this.style.display='none';previousSibling.style.display='';previousSibling.innerHTML=this.value">
    <option value=1>1</option>
    <option value=2>2</option>
    </select>
    </td>
      

  2.   

    不是要这样的效果。我在后台动态生成了一张table,在界面上点击任意单元格想弹出一个下拉菜单。
      

  3.   

    <table border=1 width=80 height=50>
    <tr>
    <td id=td1 onclick="aa();">&nbsp;</td>
    </tr>
    </table><script>
    var i=0;
    function aa()
    {
    if(i==0)
    td1.innerHTML="<select onchange=bb(this.options[this.selectedIndex].value)><option value='1'>1</option><option value=2>2</option><select>"
    i=1;

    }
    function bb(s)
    {
    td1.innerHTML=s;
    i=0;

    }</script>