Once page load is completed, I am looking for table cells which contain elements (number input fields) with an id of "check_status". I then loop over them (example simplified to a console.log).
Coffeescript
ready = ->
$('td').find('#check_status').each (i, el) =>
console.log el.val()
return
$(document).ready(ready);
$(document).on('page:load', ready);
HTML
<td>
<div>
<input type="number" value="1" name="check[status]" id="check_status">
</div>
</td>
<td>
<div>
<input type="number" value="0" name="check[status]" id="check_status">
</div>
</td>
<td>
<div>
<input type="number" value="2" name="check[status]" id="check_status">
</div>
</td>
Console.log of $('td').find('#check_status') gives me all the elements I am looking for, but console.log of el.val() gives "el is not defined". Why?