Using the cloneNode Method : Table « HTML « JavaScript DHTML

JavaScript DHTML
1. Ajax Layer
2. Data Type
3. Date Time
4. Development
5. Document
6. Event
7. Event onMethod
8. Form Control
9. GUI Components
10. HTML
11. Javascript Collections
12. Javascript Objects
13. Language Basics
14. Node Operation
15. Object Oriented
16. Page Components
17. Security
18. Style Layout
19. Table
20. Utilities
21. Window Browser
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
JavaScript DHTML » HTML » Table 
Using the cloneNode Method


/*
JavaScript Unleashed, Third Edition
by Richard Wagner and R. Allen Wyke 

ISBN: 067231763X
Publisher Sams CopyRight 2000

*/

<HTML>
<HEAD>
<TITLE> DOM cloneNode example </TITLE>
</HEAD>
<BODY ID="bodyNode">
     <TABLE ID="tableNode">
       <TBODY>
         <TR ID="tr1Node">
             <TD BGCOLOR="yellow">Row 1, Cell 1</TD>
             <TD BGCOLOR="orange">Row 1, Cell 2</TD>
         </tr>
         <TR ID="tr2Node">
             <TD BGCOLOR="red">Row 2, Cell 1</TD>
             <TD BGCOLOR="magenta">Row 2, Cell 2</TD>
          </tr>
         <TR ID="tr3Node">
              <TD BGCOLOR="lightgreen">Row 3, Cell 1</TD>
              <td BGCOLOR="beige">Row 3, Cell 2</TD></TR>
         <TR ID="tr4Node">
             <TD BGCOLOR="blue">Row 4, Cell 1</TD>
             <TD BGCOLOR="lightblue">Row 4, Cell 2</TD>
         </tr>
         <TR ID="tr5Node">
             <TD BGCOLOR="orange">Row 5, Cell 1</TD>
             <TD BGCOLOR="purple">Row 5, Cell 2</TD>
         </tr>
       </TBODY>
     </TABLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
tr3Obj = tr1Node.cloneNode(false);
alert(
       "tr3Obj.firstChild = " + tr3Obj.firstChild + "\n" +
       "tr3Obj.nodeName = " + tr3Obj.nodeName
      );
 // -->
</SCRIPT>
</BODY>
</HTML>
           
       
Related examples in the same category
1. Tabular data in Javascript with hyper link
2. Change the width of a table border
3. Change the cellPadding and cellSpacing of a table
4. Specify frames of a table
5. Change table row height
6. Specify rules for a table
7. Create table caption
8. Deleting table rows
9. Adding table rows
10. Align the cell content in a table row
11. Change the cell content in a table row
12. Vertical align the cell content in a table row
13. Align the cell content in a single cell
14. Vertical align the cell content in a single cell
15. Adding cells to a table row
16. Change the colspan of a table row
17. Insert table row: the uniqueID Property
18. Cycling Through Table frame Property Values
19. Replacing Table Cell Content
20. Inserting/Removing Row Elements
21. Modifying Table Columns
22. Accessing userProfile Data
23. Cycling Through Table rows Property Values
24. Using the Data Binding record Number Property
25. Using the offsetParent Property
26. Transforming JavaScript Data into HTML Tables
27. Transforming JavaScript Data into HTML Tables with HyperLink
w__w_w__._j_a___v__a_2s_.___co__m | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.