<input type="text" id="off" name="off" pid="1111" onchange="check(this)"/>function check(obj) {
 var pid = obj.pid;
}在IE6为什么报“缺少对象”……

解决方案 »

  1.   

    var pid = document.getElementById("off").getAttribute("pid");
      

  2.   

    function check(obj) {
     var pid = obj.getAttribute("pid");
    }
      

  3.   

    非标准属性,要用:obj.getAttribute("pid");
    的方式。
      

  4.   

    因为pid不是input标签原生的属性 所以不能使用"点"操作
    function check(obj) {
     var pid = obj.getAttribute('pid');
    }
      

  5.   

    ie 可以 直接  object.xxx 火狐用object.getAttribute('xxx')