<! 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> <Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/> <Title> Add Row example </title> <Script src = "jquery-1.6.2.min.js"> </script> <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 link is clicked and has a name of addRow $ ("Table # myTable tr: last"). after ('<tr> <td> Row 4 </td> </tr> '); Return false; }); }); </Script> </Head> <Body> <Table style = "width: 100%" id = "myTable"> <Tr> <td> Row 1 </td> </tr> <Tr> <td> Row 2 </td> </tr> <Tr> <td> Row 3 </td> </tr> </Table> <A href = "#" name = "addRow"> Add Row </a> </Body> </Html> |