title: how to improve jquery's performance or use regular replace?
body: <p>I'd like to add prefix id to all DOM element's several attributes.</p>
  
  <p>what is the best way ?</p>
  
  <p>I found jquery's find and each function is slow.
  should I use regular replace ?</p>
  
  <p>jquery's code for example:</p>
  
  <pre><code>$("body").find("id").each(function(){
      $(this).attr("id", "AAA_" + $(this).attr("id"));
  });
  
  $("body").find("label[for]").each(function(){
      $(this).attr("for", "AAA_" + $(this).attr("for"));
  });
  </code></pre>