/ Published in: HTML
This code is able to add row to a table in html using jquery.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript"> <!-- jQuery Code will go underneath this --> $(document).ready(function () { // Code between here will only run when the document is ready $("a[name=addRow]").click(function() { // Code between here will only run when the a link is clicked and has a name of addRow return false; }); }); </script> </head> <body> <table style="width: 100%" id="myTable"> </table> </body> </html>