我的 HTML 代码如下:
<div id="detail">
<div class="d_left">
Page <strong>1</strong> of 107
</div>
<div class="d_center">
<table>
<tr>
<td><a href="#">Previous</a> | <a href="#">Next</a>
<img src="/webProject/store/images/arrow.png" align="absmiddle" alt="">
</td></tr></table>
</div>
<div class="d_right">
Sort by:
<select name="featured" size="1" id="item1">
<option>Featured Items1</option>
<option>Featured Items2</option>
<option>Featured Items3</option>
<option>Featured Items4</option>
</select>
</div>
</div>
现在,我想从 <select name="featured" size="1" id="item1">
中读取选定的值.
我如何使用 JavaScript 执行此操作?
最佳答案
document.getElementById("item1").value;
关于javascript - 使用javascript代码从HTML的select标签中读取选定的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6675125/