如何用JQuery向select标签中添加option?
1、根据id获取select的jquery对象var selDom = $("#select的id")
;//根据id获取select的jquery对象2、往select中添加optionselDom.append("")
;//添加option
中关于用createElement()和appendChild()创建select的方法?
jQuery.fn.addOption = function(text,value)<br>
{<br>
jQuery(this).get(0).options.add(new Option(text,value));<br>
}<br>这是个脚本,为指定select追加option<br>function openendtime(){<br>
//var beginvalue= $(timeBegin).val();<br>
$(timeEnd).empty();//添加前清空select选项<br>
//alert(beginvalue);<br>
for(i=0;i<这里是mysql返回的数据集长度;i++){<br>
$(timeEnd).addOption(显示值,option的value值);//调用<br>
}<br><br>
}<br><br>修改下你应该就可以用!!!
怎么获得select下拉框的显示值?
引入jquery.js1 $("#selectid option:eq(1)").val(); 2 $("#selectid option").each(function(i){alert("第"+(i+1)+"个值为"+$(this).val());})

