title: Using Handlebars.js helpers to create active elements with jQuery?
body: <p>Is it possible to within a Handlebars.js helper to create elements using jQuery and attach event handler to them? I'd like to be able to create active elements using helpers.</p>
  
  <p>Example:</p>
  
  <pre><code>Handlebars.registerHelper("button", function(title) {
      var button = $('&lt;button&gt;').text(title);
      button.click(function() {
          alert("Button " + title + " clicked.");
      });
      return $('&lt;div&gt;').append(button).html();
  });
  </code></pre>
  
  <p>In the handlebars template I instantiate the button like this:</p>
  
  <pre><code>{{{button "Click Me!"}}}
  </code></pre>
  
  <p>I understand that this can not work, since the jQuery's html() function `removes' the event handler... but simply returning <em>button</em> obviously does not work either.
  Handlebars helpers should be able to return DOM nodes, but this is not possible, right? I tried to return <em>button.get()</em>, but without success. </p>
  
  <p>Any ideas?</p>