모델에서 넘어온 user라는 키 값으로 html에 아래처럼 뿌렸는데
<tbody>
<tr th:each="user : ${user}" id="userArray">
<td><input th:type="checkbox" th:name="userSelect" id="userSelect" th:value="${user.user_Auth}"></td>
<td><th:block th:text="${user.user_Id}" /></td>
<td th:name="userName" th:text="${user.user_Name}" th:value="${user.user_Name}"/><br>
</tr>
</tbody>
자바스크립트에서 아래처럼 했는데 첫번째 값 하나만 들고와서 전체 배열값을 들고 오는 방법이 어떻게 될까요
$(document).ready(function(){
if(document.getElementById("userSelect").value=='ROLE_USER'){
document.getElementById("userSelect").setAttribute('checked','checked');
document.getElementById("userSelect").setAttribute('disabled','disabled');
}
});
전체 값을 들고와서 user_Auth값이 ROLE_ADMIN이면 전부 체크된 상태로 만들려고 합니다