JavaScript获取thymleaf数组失败

我想通过JavaScript调用HTML页面中的使用thymeleaf获取的model数组值失败,只能得到第一个数据

        List<Staff> staffs = staffService.getStaff();
        model.addAttribute("staffs", staffs);
  <div id="staffs" th:each="staff : ${staffs}">
    <span id="staffApaId" th:text="${staff.getApartmentId()}"></span>
    <span id="staffName" th:text="${staff.getName()}"></span>
  </div>

```javascript
    let staff = []
    staff = $("#staffs")

```


<tr th:each="item : ${staffs}" th:object="${item}">
                <td th:text="*{item.name}"></td>

            </tr>