Hide the span with a class name jquery
<p>I am stuck on what to do when hiding a span that has a certain class name.  I can't use <code>this</code> because it refers to the input.  Here is my script:</p>

<pre><code>//uncheck all checkboxes
$("input[type=checkbox]").prop("checked", false);

$("input[type=checkbox]").each( function (index) {
    $(this).addClass("doc" + index);
})

$("input").change( function () {

    var docName = $(this).parent().find("span");
    var className = $(this).attr("class");

if(this.checked) {

        $("span.noneAttached").fadeOut('slow', function () {

            docName.clone().appendTo(".attachedDocuments").addClass(className).after("&lt;br /&gt;").text();

        });
    }

else if (!this.checked &amp;&amp; ($(".attachedDocuments &gt; span").hasClass(className))) {


    //hide the span with the class name

}

});
</code></pre>

<p>The <code>else if</code> checks to see if a checkbox is not checked and if the parent div contains any children with the class name.  If so, hide it.</p>

<p>Where do I go from here?  I am sure this answer is obvious, but I am just not seeing it.</p>
