1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <title>Tester</title> |
---|
5 | <style type="text/css"> |
---|
6 | #container { background:yellow; width:200px; } |
---|
7 | </style> |
---|
8 | <script type="text/javascript" src="../jquery.js"></script> |
---|
9 | <script type="text/javascript"> |
---|
10 | function doIt() { |
---|
11 | $("#adiv").text("click!"); |
---|
12 | $("#tableid tbody tr:eq(2)").clone().insertAfter("#tableid tbody tr:eq(0)"); |
---|
13 | alert($("#tableid tbody tr").length); |
---|
14 | } |
---|
15 | |
---|
16 | $(function () { |
---|
17 | $("#doit").click(doIt); |
---|
18 | }); |
---|
19 | </script> |
---|
20 | </head> |
---|
21 | <body> |
---|
22 | <button id="doit">Do It</button> |
---|
23 | <table id="tableid"> |
---|
24 | <tbody> |
---|
25 | <tr><td>Row 1</td></tr> |
---|
26 | <tr><td>Row 2</td></tr> |
---|
27 | <tr><td>Row 3</td></tr> |
---|
28 | </tbody> |
---|
29 | </table> |
---|
30 | <div id="adiv"></div> |
---|
31 | </body> |
---|
32 | </html> |
---|