學習 學習 再學習

          學習才是唯一的出路

            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 鐵猴 閱讀(396) 評論(0)  編輯  收藏 所屬分類: JAVASCRIPT
          主站蜘蛛池模板: 区。| 顺平县| 南江县| 汉源县| 罗城| 巴东县| 尚义县| 茶陵县| 称多县| 建宁县| 柳河县| 印江| 常山县| 台前县| 吉安市| 平度市| 柳河县| 夏河县| 始兴县| 周至县| 汉川市| 长春市| 绥德县| 东阿县| 吕梁市| 静宁县| 南部县| 双鸭山市| 安塞县| 海安县| 墨脱县| 如皋市| 奉节县| 临潭县| 亳州市| 江孜县| 布尔津县| 密山市| 高要市| 册亨县| 扶风县|