代码之家  ›  专栏  ›  技术社区  ›  Ranjith Varatharajan

获取IE11中的javascript严重错误

  •  0
  • Ranjith Varatharajan  · 技术社区  · 7 年前

    JS代码

    对于(输入变量el){
    
    

    enter image description here

    这是导致错误的代码。如果我把它注释掉,就没有错误。这就是为什么我很确定这个代码有问题。我找不到。

    JS代码

    var inputs = document.querySelectorAll("input, select, textarea");
    for(var el of inputs) {
       el.oldValue = el.value + el.checked;
    }
    

    enter image description here

    1 回复  |  直到 7 年前
        1
  •  2
  •   Francesco    7 年前

    for ... of IE不支持,如图所示 here