您的位置:首页 > Web前端 > JavaScript

JS清除dropdownlist绑定的项,并添加新项

2013-10-17 14:04 309 查看
<script type="text/javascript">
/*删除项*/
document.getElementById('KeyList').options.length = 0;
/*添加项*/
document.getElementById("KeyList").options.add(new Option( "English Title", "en_title"));
document.getElementById("KeyList").options.add(new Option( "English Keywords", "en_key_word"));
document.getElementById("KeyList").options.add(new Option( "Abstract", "en_abstract"));
document.getElementById("KeyList").options.add(new Option( "Fund Project", "fund_project"));
document.getElementById("KeyList").options.add(new Option( "Institution(in English)", "en_institution"));
document.getElementById("KeyList").options.add(new Option( "DOI", "doi"));
document.getElementById("KeyList").options.add(new Option( "Author", "pin_yin_name"));
</script>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: