var el=document.createElement("input");
el.type="text";
el.fctype="numeric";
el.id="customer_input";
document.body.appendChild(el);对不起,打错了,代码应该如上.

解决方案 »

  1.   

    不小心哦,串错字符了:)alert(document.getElementById("cutomer_input").getAttribute("fctype"));
    =>
    alert(document.getElementById("customer_input").getAttribute("fctype"));
      

  2.   

    在IE里HTML标签的属性是可以任意添加的. 
    el.id="customer_input";
    getElementById("cutomer_input")  //是不是少了一个s ??
      

  3.   

    alert(document.getElementById("customer_input").getAttribute("fctype"));
    也不行.
    :)
      

  4.   

    这段代码是不是 在<body>内或在<body>导入完后执行的?
    下面的代码执行没问题;
    或者试试 document.body.appendChild(el);=》document.appendChild(el);<html>
    <body>
    <script language="JavaScript">
      var el=document.createElement("input");
    el.type="text";
    el.fctype="numeric";
    el.id="customer_input";
    document.body.appendChild(el);
    alert(document.getElementById("customer_input").getAttribute("fctype"));
    </script>
    </body>
    </html>