<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
.a1{border:1px solid #ffcc00}/*定义onmouseover时的背景边框样式*/
.a2{border:1px solid #ffffff}/*定义onmouseout时的背景边框样式*/
</style>
<script language="javascript">
var n = 5;
function go(c)
{
for (i=1;i<=n ;i++ )
document.getElementById("l"+i).className = "a2";
document.getElementById("l"+c).className ="a1";
}
</script>
</head>
<body>
<table width="200" border="0" cellspacing="0" cellpadding="3">
<tr align="center">
<script language="JavaScript" type="text/javascript">
for(i=1;i<=n ;i++)
document.write('<td class="a2" id="l'+i+'"><a href="#" onClick="go('+i+')">样式'+i+'</a></td>');
//<td class="a2" id="l1"><a href="#" onClick="go('1')">样式1</a></td>
//<td class="a2" id="l2"><a href="#" onClick="go('2')">样式2</a></td>
//<td class="a2" id="l3"><a href="#" onClick="go('3')">样式3</a></td>
//...
</script>
</tr>
</table>
</body>
</html>