title: Meteor: Change the class of link on click
body: <p><strong>Template:</strong></p>
  
  <pre><code>&lt;template name="header"&gt;
      &lt;div class="blog-masthead"&gt;
          &lt;div class="container"&gt;
              &lt;nav class="blog-nav"&gt;
                &lt;a class="blog-nav-item {{active}}" href="{{pathFor 'homePage'}}"&gt;Home&lt;/a&gt;
                {{#if currentUser}}
                  &lt;a class="blog-nav-item {{active}}" href="#"&gt;{{Meteor.userId}}&lt;/a&gt;
                {{else}}
                  &lt;a class="blog-nav-item {{active}}" href="{{pathFor 'loginPage'}}"&gt;Login&lt;/a&gt;
                  &lt;a class="blog-nav-item {{active}}" href="{{pathFor 'signUpPage'}}"&gt;Sign Up&lt;/a&gt;
                {{/if}}
                &lt;a class="blog-nav-item {{active}}" href="#"&gt;About&lt;/a&gt;
              &lt;/nav&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p><strong>header.js</strong></p>
  
  <pre><code>Template.header.events({
      'click a': function(e) {
          e.preventDefault();
          this.active?"active":"";
      }
  });
  </code></pre>
  
  <p>I just want to make set click link's class as <code>active</code>. Clicked link class should look like <code>class="blog-nav-item active"</code>.</p>