单纯增加 可以用 innerHTML += "<input type='checkbox' />";

解决方案 »

  1.   

    在后台输出 respose.write("<script>根据ID给层加控件</script>")
      

  2.   

    <script>
    function hehe()
    {
    document.getElementById("div1").innerHTML="<span>hehe</span><input type='checkbox' name='hehe' />"
    }
    </script>
    <div id="div1">
    </div>
    <input type="button" value="Add" onclick="hehe()" />
      

  3.   

    试试看<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title> new document </title>
        <meta name="generator" content="editplus" />
        <meta name="author" content="Gao YiXiang" />
        <meta name="email" content="[email protected]" />
        <meta name="keywords" content="javascript dhtml dom" />
        <meta name="description" content="I love web development." />
    </head>
    <body>
        <input type="button" id="btnAddChk" value="Add CheckBox" />
        <div id="divContainer"></div>
    </body>
    <script type="text/javascript">
    <!--
    function $(sId)
    {
        return document.getElementById(sId);
    }var oCon = $("divContainer");var iCounter = 0;$("btnAddChk").onclick = function()
    {
        var oChk = document.createElement("input");
        oChk.type = "checkbox";
        oChk.id = "chk" + iCounter++;
        oCon.appendChild(oChk);    var oLab = document.createElement("label");
        oLab.htmlFor = oChk.id;
        oLab.innerHTML = "label for " + oLab.htmlFor;
        oCon.appendChild(oLab);    var oBr = document.createElement("br");
        oCon.appendChild(oBr);
    };
    //-->
    </script>
    </html>
      

  4.   

    http://www.cftea.com/c/2007/01/6344G8TRJHVCQ2PD.asp
      

  5.   

    就是楼上说的,自己写html当作字符串传到div里面
      

  6.   

    http://www.cnblogs.com/xiaotaomaomao/articles/986065.html
      

  7.   

    写个能增能减的,再试试<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title> new document </title>
        <meta name="generator" content="editplus" />
        <meta name="author" content="Gao YiXiang" />
        <meta name="email" content="[email protected]" />
        <meta name="keywords" content="javascript dhtml dom" />
        <meta name="description" content="I love web development." />
    </head>
    <body>
        <input type="button" id="btnAddChk" value="Add CheckBox" />
        <input type="button" id="btnRemoveChk" value="Remove Selected CheckBoxes" />
        <div id="divContainer"></div>
    </body>
    <script type="text/javascript">
    <!--
    function $(sId)
    {
        return document.getElementById(sId);
    }var oCon = $("divContainer");var iIndex = 0;$("btnAddChk").onclick = function()
    {
        var oSection = document.createElement("div");
        oCon.appendChild(oSection);    var oChk = document.createElement("input");
        oChk.type = "checkbox";
        oChk.id = "chk" + iIndex++;
        oSection.appendChild(oChk);    var oLab = document.createElement("label");
        oLab.htmlFor = oChk.id;
        oLab.innerHTML = "label for " + oLab.htmlFor;
        oSection.appendChild(oLab);
    };$("btnRemoveChk").onclick = function()
    {
        var bIsSelected = false;
        var cChk = oCon.getElementsByTagName("input");
        for (var i=cChk.length-1; i>=0; i--)
        {
            if (cChk[i].type.toLowerCase() == "checkbox" && cChk[i].checked)
            {
                bIsSelected = true;
                oCon.removeChild(cChk[i].parentNode);
            }
        }
        if (!bIsSelected)
        {
            alert("Please selected!");
        }
    }
    //-->
    </script>
    </html>
      

  8.   

    送你三本手册!DHTML参考手册
    http://download.csdn.net/source/308913样式表中文手册
    http://download.csdn.net/source/304124JScript语言参考
    http://download.csdn.net/source/308916