Get class of cloned element jquery
<p>I am looking for a way to get the class of a cloned element, if it's possible, here is my script:</p>

<pre><code>var numberOfDoc = $("input[type=checkbox]").each( function (index) {
    $(this).addClass("doc" + index);
})

$("input").change( function () {
    if(this.checked) {
        var checked = $(this).parent().find("span");
        $("span.noneAttached").fadeOut('slow', function () {
            checked.clone().appendTo(".attachedDocuments").after("&lt;br /&gt;").text();
        });
    }
    else if ($("input:checked").length == 0) {

        $("span.noneAttached").fadeIn("slow");
    }
});
</code></pre>

<p>As you can see, I am giving each checkbox it's own class name based on it's index number.  When a checkbox is clicked, it finds it's parent, then the span, clones it, and appends the text of the span to another div.</p>

<p>Right after the span is cloned, I need to be able to find the class name that the checkbox has been given and add it to the span that is being cloned and appended to keep track of where each span actually came from.</p>

<p>Any thoughts here?  Is there a better way to do this?</p>
