title: When should I bind events to elements generated by Knockout binding?
body: <p>I'm using the following markup (abridged) to display a list of person objects in a table. I would like to open an Edit Details popup when a row is clicked, but my rudimentary event binding isn't working for rows added to the table by Knockout data binding.</p>
  
  <pre><code>&lt;script&gt;
      function PersonModel(data) {
          var self = this;
          self.id = data.Id;
          self.firstName = data.FirstName;
      }
      $(function () {
          function personListModel() {
              var self = this;
              self.persons = ko.observableArray([]);
              $.getJSON("Person/IndexJson", function (allData) {
                  var mappedPersons = $.map(allData, function (item) { return new PersonModel(item); });
                  self.persons(mappedPersons);
              });
          }
          ko.applyBindings(new personListModel());
          $(".person-row").click(function () {
              alert("Hello ");
          });
      });
  &lt;/script&gt;
  &lt;table&gt;
      &lt;tbody data-bind="foreach: persons"&gt;
          &lt;tr class="person-row" data-bind="attr: { 'data-id': id }"&gt;
              &lt;td data-bind="text: firstName"&gt;&lt;/td&gt;
              &lt;td data-bind="text: surname"&gt;&lt;/td&gt;
              &lt;td data-bind="text: email"&gt;&lt;/td&gt;
              &lt;td data-bind="text: cell"&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>If I bind a click event handler from the JS console after the page has rendered and bound, that handler is correctly called, but the initial event binding in the code above simply doesn't work. What must I do to bind to rows generated by knockout. I thought it would simply be enough to bind the event handler after <code>ko.applyBindings()</code>.</p>