title: Iterate through a table finding a td by class and changing the text for that td
body: <p>I have an Entity Framework generated table with values in a td that I need to change. I need to do this on a row by row basis because I need to insert a group of radio buttons but each row of buttons needs a unique name.</p>
  
  <p>Basically, I need to set the checked value for a group of buttons based on the value of the text in a td with id of "Rate", and remove the existing text after I have got the value from it.</p>
  
  <p>My Table looks like this,</p>
  
  <pre><code>&lt;table id="IndexTable"&gt;
  &lt;tr&gt;
      &lt;th&gt;CoffeeID &lt;/th&gt;
      &lt;th&gt;Degree &lt;/th&gt;
      &lt;th&gt;Weight &lt;/th&gt;
      &lt;th&gt;Profile &lt;/th&gt;
      &lt;th&gt;UsageInfo &lt;/th&gt;
      &lt;th&gt;Comments &lt;/th&gt;
      &lt;th&gt;AmbientTemp &lt;/th&gt;
      &lt;th&gt;Rating &lt;/th&gt;
      &lt;th&gt;WeightDeducted &lt;/th&gt;
      &lt;th&gt;Selected &lt;/th&gt;
      &lt;th&gt;ProfileID &lt;/th&gt;
      &lt;th&gt;ProfileStart &lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;1 &lt;/td&gt;
      &lt;td&gt;1 &lt;/td&gt;
      &lt;td&gt;3 &lt;/td&gt;
      &lt;td&gt;9 &lt;/td&gt;
      &lt;td&gt;Filter Brew &lt;/td&gt;
      &lt;td&gt;Perfecto!! &lt;/td&gt;
      &lt;td&gt;55 &lt;/td&gt;
      &lt;td id="Rating"&gt;4.25 &lt;/td&gt;
      &lt;td&gt;1 &lt;/td&gt;
      &lt;td&gt;4 &lt;/td&gt;
      &lt;td&gt;34 &lt;/td&gt;
      &lt;td&gt;1 &lt;/td&gt;
  
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;3 &lt;/td&gt;
      &lt;td&gt;15 &lt;/td&gt;
      &lt;td&gt;99 &lt;/td&gt;
      &lt;td&gt;87 &lt;/td&gt;
      &lt;td&gt;Espresso &lt;/td&gt;
      &lt;td&gt;WTF &lt;/td&gt;
      &lt;td&gt;99 &lt;/td&gt;
      &lt;td id="Rating"&gt;4.5 &lt;/td&gt;
      &lt;td&gt;5 &lt;/td&gt;
      &lt;td&gt;3 &lt;/td&gt;
      &lt;td&gt;66 &lt;/td&gt;
      &lt;td&gt;4 &lt;/td&gt;
  
  &lt;/tr&gt;
  </code></pre>
  
  <p></p>
  
  <p>And my script is as follows.</p>
  
  <pre><code>$("tr").each(function() { //get all rows in table
  var str = $("text[id=Rating]").val(); //assign text with matching id to str ---doesn't work
  $("td").each(function() { //get all tds in current row
      var newStr = ("#Rating").text; //assign text in td with id Rating to newStr ---- doesn't work
      alert(newStr); // fires undefined for each td in table? 
      //This is where I want to insert radio buttons and assign the one with the value of the Rating td to checked.
  });
  });
  </code></pre>
  
  <p>This is just the latest, I have looked all over this site, but everything I've seen doesn't deal with getting the value from a specific column of a specific row, changing the value, and repeating for each row/column in the table.
  I come from a db background, where this is really simple and this is very frustrating.</p>