title: How can I have Meteor add an attribute to many template links?
body: <p>I'm trying to add an attribute to many external links.  The below code worked prior to Blaze, which only runs <code>Template.rendered</code> once now (but the below code doesn't run as desired one time even).</p>
  
  <p>So what is an alternative way to add an attribute to <em>many</em> links once the page has been rendered or what is the correct way to do this with Meteor now?  BTW, I researched quite a few things, including this <a href="https://github.com/avital/meteor-ui-new-rendered-callback/blob/master/new2/client/each.js" rel="nofollow">example app from the author</a>, which if it has the answer, I didn't see it.</p>
  
  <pre><code>Template.layout.rendered = function () {
    console.log('CALLED');                  // runs
    $(document).ready(function () {
      console.log('NOW THIS');              // runs
      $('a.external').each(function () {
        console.log('NOT CALLED');          // doesn't run
        $(this).attr('target', '_blank');
      });
    });
  };
  </code></pre>