js 动态生成下拉列表 下拉列表级联
来源:互联网 发布:mac会变的吗 编辑:程序博客网 时间:2024/06/10 22:09
简单的动态生成下拉列表 并且 带有级联操作
根据父级节点的值来组织子级下拉列表的值
<!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><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><script language="javascript">function changeF(fatherValue){if(fatherValue!=null){var s2 = document.getElementById('id2');//s2.length=1;s2.length = 1;//保留下拉列表的第一条,如果将所有的都清楚了,则值等于0即可for(var i=0;i<3;i++){//alert(i);var v = document.createElement('option');v.setAttribute('value', i);var inner = document.createTextNode("我的值是_"+i+"_fatherValue="+fatherValue);v.appendChild(inner);s2.appendChild(v);}}}</script></head><body>父级下拉列表:<select id="id1" name="id1" onchange="changeF(this.value);"><option value="1">1</option><option value="2">2</option><option value="3">3</option></select>子级下拉列表:<select id="id2" name="id2" onchange="javascript:alert(this.value);"><option value="-1">ok</option></select></body></html>
- js 动态生成下拉列表 下拉列表级联
- js动态生成级联下拉列表
- js动态生成级联下拉列表
- js动态生成级联下拉列表
- js动态生成级联下拉列表
- js生成级联下拉列表
- JS级联下拉列表
- js下拉列表级联案例
- js--dom--动态生成【下拉列表】
- jquery之动态级联下拉列表
- jquery之动态级联下拉列表
- jquery之动态级联下拉列表
- N级联下拉列表
- 级联下拉列表
- 级联下拉列表
- select下拉列表级联
- 级联下拉列表
- 级联下拉列表
- android 悬浮窗口
- cookie 和session 的区别详解
- 讨人厌的org.apache.jasper.JasperException: /index.jsp(14,2) The s:form tag declares that it accepts dyna
- sys.sp_rename
- MFC 下载文件
- js 动态生成下拉列表 下拉列表级联
- VS2008中开发智能设备程序的一些总结收藏
- SizeOf与Marshal.SizeOf的区别
- org.springframework.beans.NotWritablePropertyException: Invalid property 'dDuMapDao' of bean class
- SQL语句:选择分类后的第一条记录
- linux中有关页对齐的宏
- Android下Dialog及Activity屏蔽Home键详解
- DAVINCI DM365-DM368开发攻略——linux-2.6.32的移植
- 测试自我培训学习方法总结