I am using `getElementById` when I need to clone the div element.

Code:

```
printHTML( document.getElementById("div_name").cloneNode(true));

```

Now I need to use `getElementsByClassName`

CloneNode is not working when using `getElementsByClassName`. 
How can I put class name in here?

Thank's

EDIT:

When I try to use this:

```
printHTML( $('.dataTables_scroll').clone(true) );

```

You can see my function:

```
function printHTML(clonedDive){
        var iframe = document.createElement("iframe");
        document.body.appendChild(iframe);
        iframe.contentWindow.onunload = function(){
        $(".DTTT_container").show("fast");
        $("#header_outer").show("fast");
        $(".ColVis.TableTools").show("fast");
        $("#footer").show("fast");
     };
      iframe.contentWindow.document.body.appendChild(clonedDive);
      iframe.contentWindow.print();

      document.body.removeChild(iframe); 
}

```

I am getting an error in this line:

```
iframe.contentWindow.document.body.appendChild(clonedDive);

```

This is an error description:

```
Uncaught Error: NOT_FOUND_ERR: DOM Exception 8 

```