title: Set OnClick attribute of an input with TR data-key and TD cell value when select a table row
body: <p>i am driving nuts on this.</p>
  
  <p>I have a table and assign a class (<code>selected</code>) when I select the row.</p>
  
  <p>Now, I have an input within a form and this is suppose to redirect to another page when OnClick, also it should parse 2 variables.</p>
  
  <p>This 2 variables I take from the row selected.</p>
  
  <p><code>GetID</code> is the TD data-key attribute and <code>GetName</code> is the second column cell value.</p>
  
  <p>My OnClick should look like this:</p>
  
  <pre><code>onclick="location.href='test.phtml?GetID=1&amp;GetName=Name1'"
  </code></pre>
  
  <p>My Intention is:</p>
  
  <p>Click on table row, assign class 'selected' and put data-key attribute of the TR element which has the class 'selected' (as value1) and the TD cell value (as value2) in my OnClick string.</p>
  
  <p>The click thing works, but i cant get the string to work.</p>
  
  <p>I have a fiddle here: <a href="https://jsfiddle.net/765bmr7r/1/" rel="nofollow noreferrer">fiddle</a></p>