Property 'index' does not exist on type' Element'

the project starts up with an error, but you can run

by re-saving the js file.
toggleDetails() {
      var item = document.getElementsByClassName("list-wrapper");
        var next = document.getElementsByClassName("ico-next");
      var divcard = document.getElementsByClassName("divcard");
      for (var i = 0; i < item.length; iPP) {
          item[i].index = i;
          item[i].onclick = function () {
              var num = this.index;
              if (divcard[num].style.display === "block") {
                  next[num].style.transform = "rotate(0)";
                  divcard[num].style.display = "none";
              } else {
                  next[num].style.transform = "rotate(90deg)";
                  divcard[num].style.display = "block";
              }
          }
      }
  }
Apr.02,2021
The error message

is already obvious. Element does not have the field index. Item [I] is an object. There is no index field in your object. Of course, an error is reported.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e52b60-451d3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e52b60-451d3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?