title: JQuery event inside a underscore.js template
body: <p>I'm having trouble including javascript code inside an underscore.js template (particularly  a jquery .click() event). I've tried many variations of the &lt;% .. %> tags, and here is my latest:</p>
  
  <pre><code> &lt;script type="text/html" id="eventTemplate"&gt;
    &lt;% _.each(words, function(word) { %&gt;
        &lt;a data-role="button" id="eventButton &lt;%= word %&gt;" href="#" data-icon="plus" data-iconpos="right"&gt;
            &lt;%= word %&gt;
        &lt;/a&gt;
       &lt;% $('#eventButton' + word +').click(function() {
           console.log(word);
          });
       }); %&gt;
  </code></pre>
  
  <p></p>
  
  <p>Any help will be appreciated. Thanks</p>