I have a problem and search for this a while but , didnt get any soultion.
i have a page like:
<!doctype html>
<html>
<body>
<table id='mytable'>
<tr>
<thead>
<th><input type="checkbox" id="action-toggle" /></th>
<th>Institute</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr class="row1"><td><input type="checkbox" class="action-select" value="119" name="_selected_action" /></td>
<td>ABCD Engineering College</td>
<td>1.0</td></tr>
<tr class="row1"><td><input type="checkbox" class="action-select" value="119" name="_selected_action" /></td>
<td>EFGH Engineering College</td>
<td>2.0</td></tr>
<tr class="row1"><td><input type="checkbox" class="action-select" value="119" name="_selected_action" /></td>
<td>IJKL Engineering College</td>
<td>1.0</td></tr>
</tbody>
</body>
</html>
jQuery(document).ready(function($){
jQuery("#result_list tbody tr").each(function(index,el){
val=$(el).text();
(if val=='1.0'){
$("el:contains('1.0')").closest("td").find("input.action-select").attr('disabled','disabled');
}
});
});
jQuery(document).ready(function($){
jQuery("#result_list tbody tr").each(function(index,el1){
$(el1).each(function(idex,el2){
val=$(el2).text();
(if val=='1.0'){
$("el:contains('1.0')").closest("td").find("input.action-select").attr('disabled','disabled');
}
});
});
Now i want in tbody where there is version 1.0 its respective check box should get disable on page load.
I applied the .each function and two .each function as well but did not get the desired result. I would be really very helpful if could answer this .Thanks in Advance.
fiddle : http://jsfiddle.net/R27wq/1/
also include
</table>in your html code