1.JQuery获取SELECT选择的值:var sel=$("select[name='clientId']").val() , clientId为select的name属性
2.清空select下拉列表: sel.options.length=0;
3.为select添加子项:var opt = new Option('Hello', 'World'); , Hello是value,World对应下拉的显示值,如果设置该项为选中的话:
opt.selected=true; sel.options.add(opt);
2.清空select下拉列表: sel.options.length=0;
3.为select添加子项:var opt = new Option('Hello', 'World'); , Hello是value,World对应下拉的显示值,如果设置该项为选中的话:
opt.selected=true; sel.options.add(opt);