title: Is it possible to invoke the jQuery.data() method within a jQuery template?
body: <p>I'm using the jQuery template plug-in (official jquery-tmpl plugin) to build up a an HTML list. The template basically defines <code>&lt;li&gt;</code> elements and looks something like this:</p>
  
  <pre><code>&lt;script id="item-display-template"&gt; type="text/html"&gt;
    &lt;li&gt;
      &lt;div class="item-display-container"&gt;
          &lt;p&gt;${SomeData1} .... ${SomeData2} etc....&lt;/p&gt;
          &lt;a onclick="editRow();"&gt;Edit This Item&lt;/a&gt;
      &lt;/div&gt;
    &lt;/li&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>Each item in the resulting list will have an 'Edit This Item' link that will invoke an 'editRow' function. I need to be able to provide this function with the primary key (id) of the database record for the item being edited. The 'id' is included in the JSON being bound to the template. My first thought was to do this with the 'Edit This Item' link:</p>
  
  <pre><code>&lt;a onclick="editRow(${Id});"&gt;Edit This Item&lt;/a&gt;
  </code></pre>
  
  <p>I think that will work, but I'm not sure that this is the "right way".</p>
  
  <p>Is it possible to invoke the 'jQuery.data()' method within the template to attach the Id value to one of the DOM elements as the template is being rendered?</p>