title: How can I pass the current element to a Javascript function in a Knockout.js binding?
body: <p>So I'm trying to add a class to an element using Knockout.js based on whether a child checkbox is checked or not. To do so, I'm trying to pass <code>this</code> as an argument to my function. Currently, my abridged DOM structure is the following:</p>
  
  <pre><code>&lt;tr data-bind="css: { selected: isRowChecked(this) }"&gt;
      &lt;td&gt;&lt;label&gt;&lt;input type="checkbox"&gt;&lt;/label&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>An my <code>isRowChecked</code> function is this (I'm using jQuery to locate the input):</p>
  
  <pre><code>function isRowChecked(elem) {
      var checkbox = $(elem).find('input[type="checkbox"]');
      return checkbox.checked;
  }
  </code></pre>
  
  <p>Yet, if I <code>console.log</code> <code>elem</code> all I get is the global window object. </p>
  
  <p>It is not feasible to use jQuery to solve this problem completely as the project I am working in is already using knockout nearly exclusively. Any ideas?</p>