Web Development with jQuery®

(Elliott) #1

Cloning Content (^) ❘ 131



Walls and Bridges
1974









The following style sheet is linked to the preceding document:
body {
font: 12px "Lucida Grande", Arial, sans-serif;
color: rgb(50, 50, 50);
margin: 0 ;
padding: 15px;
}
table.johnLennonAlbums {
table-layout: fixed;
width: 500px;
border: 1px solid black;
border-collapse: collapse;
}
table.johnLennonAlbums th,
table.johnLennonAlbums td {
padding: 3px;
border: 1px solid black;
}
table.johnLennonAlbums th {
text-align: left;
background: lightgreen;
}
table.johnLennonAlbums tbody tr:hover {
background: lightblue;
}
tr#johnLennonAlbumTemplate {
display: none;
}
The following script demonstrates jQuery’s clone() method:
$(document).ready(
function()
{
$('button#documentAddRow').click(
function(event)
{
event.preventDefault();
[http://www.it-ebooks.info](http://www.it-ebooks.info)
Free download pdf