jsp问题求帮助
如何把list的值挨个放到下面的 document.getElementById("ss_area").checked=true 中“ ”位置处。
java javaweb web
<%
List<String> list = (List<String>)request.getAttribute("list");
System.out.println(list);
%>
<c:forEach items="<%=list %>" var="var">
${var }
</c:forEach>
<script type="text/javascript">
function check_box(){
document.getElementById("ss_area").checked=true
}
</script>
<%
List<String> list = (List<String>)request.getAttribute("list");
System.out.println(list);
%>
<script type="text/javascript">
function check_box(){
<c:forEach items="<%=list %>" var="var">
document.getElementById("ss_area").checked=${var }
</c:forEach>
}
</script>