zoukankan      html  css  js  c++  java
  • setAttribute 添加属性失效问题

    object.setAttribute(sName, vValue [, iFlags])

    参数:

    sName
    必填项. String类型,属性名

    vValue
    必填项. 为属性指定的变量,可以为string, number, 或者 Boolean类型

    iFlags
    选填. 下面指定的两种 Integer 类型的标志

    0
    覆盖同名属性.

    1
    默认值. 为属性添加指定的值.

    实力

    <html>

    <head runat="server">
        <title>无标题页</title>
        <style type="text/css">
            .TableLine
            {
                border-collapse: collapse;
                border: 1px solid #9BC2E0;
            }
            .TableLine td
            {
                border: 1px solid #9BC2E0;
            }
        </style>

        <script type="text/javascript">
            function a(){
            document.getElementById("td_ID").setAttribute("colspan","2",0); //成功

           //document.getElementById("td_ID").setAttribute("colspan","2"); 失败
      
            }
        </script>

    </head>
    <body onload="a()">
        <form id="form1" runat="server">
        <table id="TableID" class="TableLine">
            <tr>
                <td>
                    1
                </td>
                <td>
                    2
                </td>
            </tr>
            <tr>
                <td id="td_ID">
                    dasfasfd
                </td>
            </tr>
             <tr>
                <td colspan="2">
                    d
                </td>
            </tr>
        </table>
        </form>
    </body>
    </html>

  • 相关阅读:
    操作系统-微内核操作系统
    设备管理-虚设备与SPOOLING技术
    设备管理-数据传输控制方式
    文件管理-空闲存储空间的管理
    文件管理-索引文件结构
    Alpha冲刺8
    Alpha冲刺7
    Alpha冲刺6
    Alpha冲刺5
    Alpha冲刺4
  • 原文地址:https://www.cnblogs.com/ok519/p/1513128.html
Copyright © 2011-2022 走看看