zoukankan      html  css  js  c++  java
  • js 循环控件

      var controls = document.getElementById("tbsell").getElementsByTagName('input');

                                    for (var i = 0; i < controls.length; i++) {
                                        if (controls[i].type == 'text') {
                                            controls[i].value = brr[i];
                                        }
                                    }

      <table class="table_noborder_fontleft" id="tbsell" style=" border:0px;">
                                <tr>
                                    <td>
                                        <input type="text" maxlength="10" id="sellpro1" style=" 68px;" />
                                        &nbsp;
                                        <input type="text" maxlength="10" id="sellpro2" style=" 68px;" />
                                        &nbsp;
                                        <input type="text" maxlength="10" id="sellpro3" style=" 68px;" />
                                        &nbsp;
                                        <input type="text" maxlength="10" id="sellpro4" style=" 68px;" />
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input type="text" maxlength="10" id="sellpro5" style=" 68px;" />
                                        &nbsp;
                                        <input type="text" maxlength="10" id="sellpro6" style=" 68px;" />
                                        &nbsp;
                                        <input type="text" maxlength="10" id="sellpro6" style=" 68px;" />
                                        &nbsp;
                                        <input type="text" maxlength="10" id="sellpro7" style=" 68px;" />
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input type="text" maxlength="10" id="sellpro8" style=" 68px;" />
                                        &nbsp;
                                        <input type="text" maxlength="10" id="sellpro9" style=" 68px;" />
                                        &nbsp;
                                        <input type="text" maxlength="10" id="sellpro10" style=" 68px;" />
                                        &nbsp;
                                        <input type="text" maxlength="10" id="sellpro11" style=" 68px;" />
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>

  • 相关阅读:
    ITIL 4Foundation认证
    Linux服务器安全之 fail2ban的安装与配置
    Linux的常用基础命令
    jQuery源码学习(2):选择器初窥
    jQuery源码学习(1):整体架构
    从字符串拼接看JS优化原则
    理解函数作用域与闭包
    JavaScript DOM节点操作总结
    函数声明与函数表达式、变量提升
    CSS长度单位详解
  • 原文地址:https://www.cnblogs.com/ggbbeyou/p/1588306.html
Copyright © 2011-2022 走看看