title: Different events in same Handlebars script
body: <p>I've got the next doubt/problem. I need to use some Id's that are loaded by a Handlebars script.
  Once I get the values, a table, I would like to be able to execute another ajax call if I push a button</p>
  
  <p>Here's the code:</p>
  
  <p>HTML: </p>
  
  <pre><code>div class="container"&gt;
      &lt;table class="table"&gt;
          &lt;thead class="thead-dark"&gt;
              &lt;tr&gt;
                  &lt;th scope="col"&gt;Nombre&lt;/th&gt;
                  &lt;th scope="col"&gt;Valor&lt;/th&gt;
                  &lt;th scope="col"&gt;Tipo&lt;/th&gt;
                  &lt;th scope="col"&gt;Cron&lt;/th&gt;
                  &lt;th scope="col"&gt;&lt;/th&gt;
                  &lt;th scope="col"&gt;&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody class= "tbody"&gt;
              &lt;script id="properties-template" type="text/x-handlebars-template"&gt;
                  {{#each properties}}
                  &lt;tr&gt;
                      &lt;th&gt;{{clave}}&lt;/th&gt;
                      &lt;td&gt;{{valor}}&lt;/td&gt;
                      &lt;td&gt;{{variable}}&lt;/td&gt;
                      &lt;td&gt;{{cron}}&lt;/td&gt;
                      &lt;td&gt;&lt;button class="btn"&gt;&lt;i class="fa fa-pencil"&gt;&lt;/i&gt;&lt;/button&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;button class="btn"&gt;&lt;i class="fa fa-trash"  id="{{id}}" style="color:red"&gt;&lt;/i&gt;&lt;/button&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  {{/each}}
              &lt;/script&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>$(document).ready(function(){
  $.ajax({
         url: URL_address,
      success: function(data){
        var source = $("#properties-template").html();
        var template = Handlebars.compile(source);
        $('.tbody').append(template(data));
      },
      error: function(data) {
        console.log('error', data);
      }
    })   
  });
  </code></pre>
  
  <p>I've tried to achieve what I need doing $(".fa-trash").click(..) but I get an undefined. How can I do?</p>