Can I pass a div and its contents to another page
<p>I have a clickable div generated from a loop. I am trying to set it up so that onclick it appends itself to another div on a different page. Is this possible. Here is what I have tried.</p>

<pre><code>     userDiv.addEventListener("click",
            function () {
                var one = document.getElementById('userDiv');
                var two = document.getElementById('singleUser');
                two.appendChild(one);
                window.open("Createtask.html");
     }
</code></pre>

<p><strong>EDIT</strong> here is all the code</p>

<pre><code>   var theID;
    var theName;
    var thePhoto;
    var len = results.rows.length;
    console.log(len);
    for (var i = 0; i &lt; len; i++) {
        theID = results.rows.item(i).id;
        console.log(theID);
        theName = results.rows.item(i).username;
        var htmlStr = theName;
        console.log(theName);
        thePhoto = results.rows.item(i).imagepath;
        console.log(thePhoto);

        var imageHold = new Image();
        imageHold.src = thePhoto;
        console.log("this is the src:" + imageHold.src);
        var userDiv = document.createElement("div"); //Create the div
        userDiv.innerHTML = htmlStr;
        userDiv.appendChild(imageHold);
        imageHold.width = 100;
        imageHold.height = 100;
        document.getElementById('showUsers').appendChild(userDiv); //append it to the document
        userDiv.style.display = 'block';


        identity = results.rows.item(i).username;
        userDiv.id = identity;
        console.log(identity);
        userDiv.addEventListener("click",

            function () {
                var w = window.open("Createtask.html");
                w.addEventListener("load", function(){
                  var one = document.getElementById('userDiv');
                  var two = w.document.getElementById('singleUser');
                  two.appendChild(one);
                });
    });
}
}
</code></pre>
