Side navigation
Ticket #1617: jquery_test.html
File jquery_test.html, 0.9 KB (added by davidserduke, November 28, 2007 05:43AM UTC)
test case
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Tester</title>
<style type="text/css">
#container { background:yellow; width:200px; }
</style>
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript">
function doIt() {
$("#adiv").text("click!");
$("#tableid tbody tr:eq(2)").clone().insertAfter("#tableid tbody tr:eq(0)");
alert($("#tableid tbody tr").length);
}
$(function () {
$("#doit").click(doIt);
});
</script>
</head>
<body>
<button id="doit">Do It</button>
<table id="tableid">
<tbody>
<tr><td>Row 1</td></tr>
<tr><td>Row 2</td></tr>
<tr><td>Row 3</td></tr>
</tbody>
</table>
<div id="adiv"></div>
</body>
</html>
Download in other formats:
Original Format
File jquery_test.html, 0.9 KB (added by davidserduke, November 28, 2007 05:43AM UTC)
test case
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Tester</title>
<style type="text/css">
#container { background:yellow; width:200px; }
</style>
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript">
function doIt() {
$("#adiv").text("click!");
$("#tableid tbody tr:eq(2)").clone().insertAfter("#tableid tbody tr:eq(0)");
alert($("#tableid tbody tr").length);
}
$(function () {
$("#doit").click(doIt);
});
</script>
</head>
<body>
<button id="doit">Do It</button>
<table id="tableid">
<tbody>
<tr><td>Row 1</td></tr>
<tr><td>Row 2</td></tr>
<tr><td>Row 3</td></tr>
</tbody>
</table>
<div id="adiv"></div>
</body>
</html>