Removal of multiple fields and labels
<p>I'm very new to jQuery and have been stumped by particular issue. I am dynamically adding 2 checkbox fields to a screen form using the code below:</p>

<pre><code>var summon_search = "&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;label for='summon_search'&gt;Search this resource from compatible products*&lt;/label&gt;&lt;input type='checkbox' id='summon_search' &gt;";
var summon_link = "&lt;br&gt;&lt;br&gt;&lt;label for='summon_link'&gt;Link direct from content items in compatible products*&lt;/label&gt;&lt;input type='checkbox' name='summon_link'&gt;";
$(summon_search+summon_link).insertAfter("#jstor_selection");
</code></pre>

<p>However I have had limited success when I want to remove these fields AND labels (which is dependant on another value) and replace them with new fields. The code below shows my best attempt so far. It does appear to remove the labels and first field, but for some reason the last field remains. Could someone please advise if they can spot anything I've done wrong, or perhaps supply a better example of handling this ?</p>

<pre><code>if ($("#summon_search").length &gt; 0 ) { 
    //Removal of Label and Field (Attempted) 
    $("label[for=summon_search]").remove();
    $("label[for=summon_link]").remove();
    $("#summon_search").remove();
    $("#summon_link").remove();
</code></pre>

<p>Any feedback much appreciated.</p>
