<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ru" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Toggle</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#pallete td').toggle(
function() {
$(this).css('background','#F80000');
},
function() {
$(this).css('background','#FFFFFF');
}
);
});
</script>
<style type="text/css">
table {
border: 1px solid #DDDDDD;
margin: 0px auto;
width: 100px;
height: auto;
}
td {
padding: 5px 15px 5px;
height: 20px;
}
</style>
</head>
<body>
<table id="pallete">
<tr>
<td>SomeText</td>
</tr>
</table>
</body>
</html>
PS: если нужно обращаться к индексам элементов, то можно так td:eq(0);