87,989
社区成员
发帖
与我相关
我的任务
分享
<head runat="server">
<script src="jquery.js" type="text/javascript"></script>
<title></title>
<style type="text/css">
</style>
<script type="text/javascript">
$(function(){
$('#to-clone').clone()
.find(':text').val('').end()
.find(':checked').removeAttr('checked').end()
.appendTo($('#to-append'));
});
</script>
</head>
<body>
<table id="to-append">
<tr id="to-clone">
<td>
<input type="text" value="init" />
<input type="checkbox" checked="checked" />
<input type="text" value="init" />
<input type="checkbox" checked="checked" />
</td>
</tr>
</table>
</body>
<table>
<tr>
<td>1</td>
<td><input name="hiddenField" type="hidden" id="hiddenField" value="1" /> <input type="button" value="prev" class="prev"/></td>
<td><input type="button" value="next" class="next"/></td>
</tr>
<tr>
<td>2</td>
<td><input name="hiddenField" type="hidden" id="hiddenField" value="2" /><input type="button" value="prev" class="prev"/></td>
<td><input type="button" value="next" class="next"/></td>
</tr>
<tr>
<td>3</td>
<td><input name="hiddenField" type="hidden" id="hiddenField" value="3" /><input type="button" value="prev" class="prev"/></td>
<td><input type="button" value="next" class="next"/></td>
</tr>
<tr>
<td>4</td>
<td><input name="hiddenField" type="hidden" id="hiddenField" value="4" /><input type="button" value="prev" class="prev"/></td>
<td><input type="button" value="next" class="next"/></td>
</tr>
<tr>
<td>5</td>
<td><input name="hiddenField" type="hidden" id="hiddenField" value="5" /><input type="button" value="prev" class="prev"/></td>
<td><input type="button" value="next" class="next"/></td>
</tr>
<tr>
<td>6</td>
<td><input name="hiddenField" type="hidden" id="hiddenField" value="6" /><input type="button" value="prev" class="prev"/></td>
<td><input type="button" value="next" class="next"/></td>
</tr>
</table>
$(function() {
// setup ul.tabs to work as tabs for each div directly under div.panes
$("ul.tabs").tabs("div.panes > div");
$(".next").click(function(){
var curtr = $(this).closest("tr");
var curid=curtr.find('input:hidden').val();
var nexttr=curtr.next();
var nextid =nexttr.find('input:hidden').val();
nexttr.find('input:hidden').val(curid);
curtr.find('input:hidden').val(nextid);
curtr.before(curtr.next());
alert(curtr.find('input:hidden').val());
});
$(".prev").click(function(){
var tr = $(this).closest("tr");
tr.after(tr.prev());
});