學習 學習 再學習

          學習才是唯一的出路

            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 鐵猴 閱讀(391) 評論(0)  編輯  收藏 所屬分類: JAVASCRIPT
          主站蜘蛛池模板: 长阳| 突泉县| 武冈市| 崇明县| 德阳市| 那坡县| 盐城市| 古丈县| 巫溪县| 富源县| 台江县| 孝感市| 怀集县| 高邮市| 双城市| 厦门市| 鄂温| 盐亭县| 桐庐县| 禄丰县| 林州市| 吉隆县| 烟台市| 勐海县| 二连浩特市| 禄丰县| 且末县| 宁海县| 株洲市| 陆丰市| 阿图什市| 潜山县| 眉山市| 冷水江市| 汉源县| 民乐县| 布尔津县| 桂平市| 南城县| 尚志市| 泾源县|