学习 学习 再学习

学习才是唯一的出路

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  31 随笔 :: 1 文章 :: 8 评论 :: 0 Trackbacks

获取显示的汉字

document.getElementById("bigclass").options[window.document.getElementById("bigclass").selectedIndex].text

获取数据库中的id

window.document.getElementById("bigclass").value

获取select组分配的索引id

window.document.getElementById("bigclass").selectedIndex


例子:

<select name="bigclass" id="bigclass" onChange="javascript:updatePage2();">
<option value="" selected="selected">ajax实验</option>
<option value="4">我适宜市哈</option>
</select>


使用
document.getElementById("bigclass").options[window.document.getElementById("bigclass").selectedIndex].text
的结果是:我适宜市哈

使用
window.document.getElementById("bigclass").value
的结果是:4

使用
window.document.getElementById("bigclass").selectedIndex
的结果是:1

0
0
(请您对文章做出评价)


J-CN工作室
www.j-cn.org
posted on 2009-11-06 11:24 铁猴 阅读(372) 评论(0)  编辑  收藏 所属分类: JAVASCRIPT

只有注册用户登录后才能发表评论。


网站导航: