I have a problem selecting an element from the html throght jQuery. It could be maybe the fact that the element i am trying to access is dynamically insterted throught getJson, but of course before executing the following js. What can be the problem and how can be solved?
<table id="myTable">
<tbody>
<!-- inserted with getJson -->
<tr>
<td> <input type='checkbox' id="myInput0"> </td>
<td class="myClass">some text</td>
</tr>
<!-- other rows -->
</tbody>
</table>
var id = "myInput" + 0;
var text = $("#"+id).closest('tr').find('td.myClass').text();
alert(text)