day05
1.jquery获取表格中数据的办法:
$("#q1").click(function(){
alert($(this).parent().parent().children("td").get(0).innerHTML);
});
表结构为:
<body>
<h1 id="title" align="center"> all users page </h1>
<div id="userpage">
<table class="table">
<tr >
<td>count</td>r
<td>id</td>
<td>username</td>
<td>password</td>
<td>age</td>
<td>gender</td>
<td>salay</td>
<td>IDcard</td>
<td>regintime</td>
<td></td>
<td></td>
</tr>
<c:forEach items="${users}" var="u" varStatus="s">
<tr class="tr">
<td>${s.count}</td>
<td>${u.id}</td>
<td>${u.username}</td>
<td>${u.password}</td>
<td>${u.age}</td>
<td>${u.gender}</td>
<td>${u.salay}</td>
<td>${u.IDcard}</td>
<td>${u.regintime}</td>
<td><input type="button" id="q1" value="delete"/></td>
<td><input type="button" value="update"/></td>
</tr>
</c:forEach>
</table>
</div>
</body>
-----2016-03-17 09:38