//遍历全部option,如果value与原option-selected值相同,则把该option设为selected
<script>
function setSelected() {
var oldType = document.getElementById("type").value;
var types = document.getElementById("ntid");
for ( var i = 0; i < types.options.length; i++) {
if (types.options[i].value == oldType) {
types.options[i].selected = true;
}
}
}
</script>