zoukankan      html  css  js  c++  java
  • 连动html(select)标签操作 原创(create by le)

     代码是最好的解释,请看代码,呵呵!

    代码
      function ChangeCustomId(obj) {
                
    var opt = obj.options[obj.selectedIndex]
                
    //alert("The option you select is:" + opt.text + "(" + opt.value + ")");
     
                
    var opt = obj.options[obj.selectedIndex]
                
    var selectItem = document.getElementsByName("mySelect1");
                
    for (i = 0; i < selectItem.length; i++) {
                    selectItem[i].selectedIndex 
    = obj.selectedIndex;
                }
            }
    <
    select id="mySelect" name="mySelect" onchange="ChangeCustomId(this)"><option>1</option>
    <option>4</option>
    <option>5</option>
    <option>6</option>
    <option>9</option>
    <option>10</option>
    <option>14</option>
    <option>15</option>
    <option>16</option>
    </select>
                
    </th>

    function ChangeCustomId(obj) {
                var opt = obj.options[obj.selectedIndex]
                //alert("The option you select is:" + opt.text + "(" + opt.value + ")");

                var opt = obj.options[obj.selectedIndex]
                var selectItem = document.getElementsByName("mySelect1");
                for (i = 0; i < selectItem.length; i++) {
                    selectItem[i].selectedIndex = obj.selectedIndex;
                }
            }

  • 相关阅读:
    7种思维
    微服务架构
    最近面试被问到一个问题,AtomicInteger如何保证线程安全?
    Socket netty ...
    Spring-Boot配置文件web性能(服务器)配置项
    P2P互联网金融企业的四大转型方向
    分布式,微服务 区别联系 理解.
    几个好问题
    netty
    结构化思维
  • 原文地址:https://www.cnblogs.com/chenli0513/p/1865977.html
Copyright © 2011-2022 走看看