2014年11月14日
摘要: 动态删除select中的所有options: document.getElementById("ddlResourceType").options.length=0; 动态删除select中的某一项option: document.getElement... 阅读全文
posted @ 2014-11-14 17:58 尼欧 阅读(299) 评论(0) 推荐(0) 编辑
摘要: jquery的change 事件 . jquery获取select选择的文本与值 获取select 选中的 text : $("#ddlregtype").find("option:selected").text(); 获取select选中的 value: $("#ddlregtype ... 阅读全文
posted @ 2014-11-14 17:48 尼欧 阅读(840) 评论(0) 推荐(0) 编辑
摘要: var obj = document.getElementByIdx_x(”testSelect”); //定位idvar index = obj.selectedIndex; // 选中索引var text = obj.options[index].text; // 选中文本var value =... 阅读全文
posted @ 2014-11-14 17:24 尼欧 阅读(1426) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-11-14 16:02 尼欧 阅读(500) 评论(0) 推荐(0) 编辑
摘要: 一、onChange事件只有在值改变时才可触发,所以必须在每一次选择时(尤其第一次)保证选择的值是改变的!所以这样在选择第二个时,值就会变即可触发onChange;二、我们用Select的onchange事件时,常会遇到这样一个问题,那就是连续选相同一项时,不触发onchange事件.select的... 阅读全文
posted @ 2014-11-14 16:00 尼欧 阅读(28965) 评论(0) 推荐(1) 编辑
摘要: 1.动态创建select function createSelect(){var mySelect = document.createElement("select"); mySelect.id = "mySelect"; document.body.appendChild(mySelect); }... 阅读全文
posted @ 2014-11-14 15:57 尼欧 阅读(946) 评论(0) 推荐(0) 编辑