Here's a little demo. The selector in this case is $('td'). It could be $('.cellTextGreyLeft'), $('td.cellTextGreyLeft'), or even $('td.cellTextGreyLeft[width=33]'). There are other possibilities for the selector. Things would be a little bit simpler if you were going for just the onclick of the inputs. Those are included here though, because they are in the td's.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
jQuery(function($){
$('td').click(function(){
var cname = $(this).find('input').get(0).className.split(' '), cnum = cname[2].substr(6);
alert((cnum % 2 === 0? 'View' : 'Agree') + cname[1].substr(12) + 'Cluster' + cname[2]);
});
});
</script>
</head>
<body>
<table>
<tr>
<td width="33" class=cellTextGreyLeft><input type="checkbox" class="selectColumn selectColumnAmericas column17 " name="strCustTerr1" value="" align="middle" /></td>
</tr>
<tr>
<td width="33" class=cellTextGreyLeft><input type="checkbox" class="selectColumn selectColumnAsia column10 " name="strCustTerr19" value="" align="middle" /></td>
</tr>
</table>
</body>
</html>
Bookmarks