怎样动态显示用户选择的下拉列表的值?
- HTML code
<td colspan=3> <select id="currency" name="currency"> <option id="1" value="one">1</option> <option id="1" value="two">2</option> </select></td>
怎样达到这个效果:
用户选择一项后,在下拉框的旁边高亮显示他选择的值?
谢谢
[解决办法]
- JScript code
document.getElementById("currency").options[document.getElementById("currency").selectedIndex].value //获取select的valuedocument.getElementById("currency").options[document.getElementById("currency").selectedIndex].text //获取选中项的文本