title: js event in a handlebars template
body: <p>When i click on a button, my template who have a table is feeded.</p>
  
  <p>I want to do an action when i double click to a row of a table in a handlebar template.</p>
  
  <pre><code>&lt;body&gt;
  &lt;script id="lodgerSearchResult-template" type="text/x-handlebars-template"&gt;
      &lt;div class="span12"&gt;
      &lt;table id="lodgerSearchResultTable" data-show-header="true" class="table" data-toggle="table" data-height="250"&gt;
      &lt;thead&gt;
      &lt;tr&gt;
      &lt;th&gt;#&lt;/th&gt;
      &lt;th&gt;Nom&lt;/th&gt;
      &lt;th&gt;Date de naissance&lt;/th&gt;
      &lt;th&gt;N.A.S.&lt;/th&gt;
      &lt;th&gt;N.A.M.&lt;/th&gt;
      &lt;th&gt;Immeuble&lt;/th&gt;
      &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
         {{#each this}}
         &lt;tr&gt;
           ...
           ...
         &lt;/tr&gt;
         {{/each}}
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/script&gt;
  &lt;/body&gt;
  
  
  
  &lt;script&gt;
     $('#lodgerSearchResultTable &gt; tbody').dblclick(function () {
      alert($(this).text());
     });
  &lt;/script&gt;
  </code></pre>
  
  <p>Actually, nothing happen.</p>
  
  <p>Edit: i put the double click event in the ajax success answer</p>
  
  <pre><code>$('#lodgerSearch').on('click', function (e) {
  
      var searchParam = $('#srch-term').val();
      var url = "http://localhost:8080/lodgers/search";
      if (searchParam != "") {
          url = "http://localhost:8080/lodgers/search?searchTemp=" + searchParam;
      }
  
      jQuery.ajax({
          type: "GET",
          url: url,
          success: function (data, status, jqXHR) {
  
              $("#lodgerSearchResult").empty().append(template(data));
              // is the line i added
              $('#lodgerSearchResultTable &gt; tbody').dblclick(function () {
                  alert($(this).text());
              });
  
          },
          error: function (jqXHR, status) {
              // error handler
              alert("error " + jqXHR + " -  " + status);
          }
      });
      // e.preventDefault();
  });
  </code></pre>
  
  <p>Is there a cleaner way to do the same thing?</p>