Question: I'm new to jQuery, and maybe I'm going about this all wrong...

I need to select the nth td of every tr, do some math on it (divide the value by 60) and return the new value to the td.

```js
$('#table tbody').find('tr td:eq(2)').text($(this).text() / 60);
```

```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<table>
  <tbody>
    <tr>
      <td>John</td>
      <td>2</td>
      <td>800</td>
      <td>4</td>
    </tr>
    <tr>
      <td>Sally</td>
      <td>5</td>
      <td>610</td>
      <td>9</td>
    </tr>
    <tr>
      <td>Bob</td>
      <td>7</td>
      <td>249</td>
      <td>3</td>
    </tr>
  </tbody>
</table>
```

The jquery docs [give examples](https://api.jquery.com/find/) of manipulating the css this way, so it seems like I'd be able to do that through .text() as well.

The console is not returning any errors, and also executes a console.log afterwards so I know it's continuing, but none of the values change in the DOM.

Should I be using .each() instead of .find()? Any help is appreciated.

Answer: 
You need to use a function argument to `.text()`. The function is called with the old value of the text as an argument, and the return value replaces it.

```
$('#table tbody').find('tr td:nth-child(2)').text(function(i, oldtext)
    return parseInt(oldtext)/60;
});

```

If you don't use a function, `$(this).text()/60` is executed *before* calling `text()`, so it uses whatever `this` is in the calling context.

You also need to use `:nth-child`, not `:eq`, to access the third cell in each row. Otherwise, it just accesses the third cell in the entire result set.
@Rory and @Barmar have great answers and are the ones I'd use for the above implementation, but I noticed a couple of things that might be helpful for future jQuery dev work. First I didn't see an ID in the code with the value of 'table' so jQuery wouldn't find any of the tds because it couldn't find the id='table'. Second the way the find function works above will only find the third td that follows all the trs. If you want all tds in position 2 from a list of all trs then you'd need to set up the array to look for each group of trs like this: `$('table body tr')` and then use the find on the tds. Lastly, if you wanted to use an each statement you could do something like below:

```js
var els = $('table tbody tr').find('td:eq(2)');
$.each(els, function(index,value){
    var thisNum = parseInt($(value).text());
    $(value).text(thisNum / 60);
});
```

```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
  <tbody>
    <tr>
      <td>John</td>
      <td>2</td>
      <td>800</td>
      <td>4</td>
    </tr>
    <tr>
      <td>Sally</td>
      <td>5</td>
      <td>610</td>
      <td>9</td>
    </tr>
    <tr>
      <td>Bob</td>
      <td>7</td>
      <td>249</td>
      <td>3</td>
    </tr>
  </tbody>
</table>
```