title: How can I return the cloned element from this jQuery function
body: <p>Here's what i have:</p>
  
  <pre><code>jQuery.fn.convertInputType = function(t){
    var e = this;
    e.each(function(i){
      var o = jQuery(this)
      ,   c = o.clone();
      c.attr('type',t);
      o.replaceWith(c);
    });
    return e;
  }
  </code></pre>
  
  <p>I can't figure out what to return back out to make it chain, like:</p>
  
  <pre><code>$('.example').convertInputType('password').css('background','blue');
  </code></pre>
  
  <p>I thought i could build an array like <code>newReturnObj[i] = o.replaceWith(c)</code> or <code>newReturnObj[i] = c</code> or <code>newReturnObj[i] = jQuery(c)</code>, but none work.</p>