标题:js问题请教,下拉菜单报错
只看楼主
gesongs
Rank: 3Rank: 3
等 级:论坛游侠
威 望:3
帖 子:129
专家分:100
注 册:2011-7-7
结帖率:52.78%
已结贴  问题点数:18 回复次数:1 
js问题请教,下拉菜单报错
下述是一个下拉菜单 但是有问题请懂行的人指点
<script>
 i = 1;
function dian_add(){
  document.getElementById("d").innerHTML+='<div id="div_'+i+'">
                                                                单位:<select name="bu_men" id="bu_men">
                                                                      <option value="" selected="selected">
                                                                      </option><%do while not rs100.eof%>
                                                                      <option value="<%=rs100("bu_men")%>"><%=rs100("bu_men")%></option>
                                                                      <%rs100.movenext %>
                                                                      <%loop%>
                                                                      <input type="button" value="删除"  onclick="del('+i+')"/>
                                              </div>';
  i = i + 1;
}
function del(o){ document.getElementById("d").removeChild(document.getElementById("div_"+o));}
</script>
搜索更多相关主题的帖子: 菜单 function selected option 
2011-11-25 20:42
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
得分:18 
<script>
i = 1;
function dian_add()
{
  var temp='<div id="div_'+i+'">';
  temp+='单位:<select name="bu_men" id="bu_men">';
  temp+='<option value="" selected="selected">';
  temp+='</option>';
<%
   do while not rs100.eof
      Response.Write "temp+='<option value="&rs100("bu_men")&">"&rs100("bu_men")&"</option>';"
      rs100.movenext
   loop
%>
  temp+='<input type="button" value="删除"  onclick="del('+i+')"/>';
  temp+='</div>';
  i = i + 1;
  document.getElementById("d").innerHTML=temp;
}
function del(o)
{
  document.getElementById("d").removeChild(document.getElementById("div_"+o));
}
</script>
2011-11-27 12:04



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-356235-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.051317 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved