title: How to fetch td elements and pass to javascript function?
body: <p>I have following HTML code:</p>
  
  <pre><code>&lt;table&gt;
     &lt;th&gt;Items&lt;/th&gt;&lt;th&gt;Rate&lt;/th&gt;&lt;th&gt;Quantity&lt;/th&gt;
     &lt;tr&gt;&lt;td&gt;Item A&lt;/td&gt;&lt;td&gt;20&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="txtItemA"/&gt;&lt;/td&gt;&lt;/tr&gt;
     &lt;tr&gt;&lt;td&gt;Item B&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="txtItemB"/&gt;&lt;/td&gt;&lt;/tr&gt;
     &lt;tr&gt;&lt;td&gt;Item C&lt;/td&gt;&lt;td&gt;30&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="txtItemC"/&gt;&lt;/td&gt;&lt;/tr&gt;
     &lt;tr&gt;&lt;td&gt;Total Price&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="txtPrice"/&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>On the onblur event of textboxes, I want to call a javascript function which will multiply the quantity added by the user to the rate and display it in txtPrice textbox. But I am stuck in the logic that how should I pick the rate corresponding to the quantity entered.</p>
  
  <p>For example: When I enter 2 in txtItemA textbox, 40 should get displayed in txtPrice textbox. Javascript function is simple it will just multiply rate with quantity entered and display it in txtPrice.</p>
  
  <p>What should I do to get to fetch the associated rate against the quantity and pass it to javascript function?</p>
  
  <p>Javascript function</p>
  
  <pre><code>function DisplayTotal(rate, quantity)
  {
    document.getElementById('txtPrice').innerText = rate * quantity;
  }
  </code></pre>