📌  相关文章
📜  错误无法设置未定义的属性“可见性” - Javascript代码示例

📅  最后修改于: 2022-03-11 15:02:55.633000             🧑  作者: Mango

代码示例1
function openNav() {
  // document.getElementById("mySidenav").style.width = "250px";
  targList = document.getElementsByClassName("targ");
  document.getElementsByClassName("targ")
  if (targList) {
    for (var x = 0; x < targList.length; x++) {
      targList[x].style.visibility = "hidden";
    }
  }
  document.getElementById("targimg").style.textAlign = "center";
}