title: jQuery - cloning and manipulating variables
body: <p>I'm attempting to troubleshoot an old Wordpress plugin that uses jQuery to do some variable manipulation. The original code is as follows:</p>
  
  <pre><code>            var p = $(this).parents('.postbox'); /*wp*/
              var the_name = $(this).attr('class').match(/docopy-([a-zA-Z0-9_-]*)/i)[1];
              var the_group = $('.wpa_group-'+ the_name +':first.tocopy', p);
              var the_clone = the_group.clone().removeClass('tocopy last');
  </code></pre>
  
  <p>I don't believe the clone function is working correctly. My test code is as follows:</p>
  
  <pre><code>            var the_name = "name";
              console.log(the_name);
              var the_group = $('.wpa_group-'+ the_name +':first.tocopy');
              console.log(the_group);             
              var the_clone = the_group.clone().removeClass('tocopy last');
              console.log(the_clone);
              var the_clone_test = the_group.clone();
              console.log(the_clone_test);
  </code></pre>
  
  <p>Neither the original clone function (with the removeClass) or my clone test return any data to the console. Am I missing something really simple here? I don't believe the code has been modified since the site was built, but WordPress or jQuery versions may have changed in the meantime.</p>