<select id='info' onchange='change(this)'>
<option value='student' selected>学生
<option value='tester'>考生
</select>
<br>
<label id='lab'>学号</label>
<script>
function change(obj){
document.getElementById('lab').innerText = obj.options[obj.selectedIndex].text.substr(0,1)+'号';
}
</script>
<option value='student' selected>学生
<option value='tester'>考生
</select>
<br>
<label id='lab'>学号</label>
<script>
function change(obj){
document.getElementById('lab').innerText = obj.options[obj.selectedIndex].text.substr(0,1)+'号';
}
</script>
<option value='student' labelTxt="学号" selected>学生
<option value='tester' labelTxt="考号">考生
</select>
<br>
<label id='lab'>学号</label>
<script>
function changeFun(obj){
document.getElementById('lab').innerText = obj.options[obj.selectedIndex].labelTxt;
}
</script>