日期:2014-05-16 浏览次数:20392 次
<script>
function sele_record(sele_tr){
$(sele_tr).css("color","#f11");
//下面不知道怎么写了
$(sele_tr).firstChild().firstChild().attrib("chicked","chicked
}
</script>
<body>
<table>
<tr onclick="sele_record(this)" >
<td><input type="radio" name="t_table " value="002" /> </td>
<td>002</td><td>abc</td><td>def</td>
<tr>
<tr onclick="sele_record(this)" >
<td><input type="radio" name="t_table " value="003" /> </td>
<td>003</td><td>abc</td><td>def</td>
<tr><tr onclick="sele_record(this)" >
<td><input type="radio" name="t_table " value="004" /> </td>
<td>004</td><td>abc</td><td>def</td>
<tr><tr onclick="sele_record(this)" >
<td><input type="radio" name="t_table " value="005" /> </td>
<td>005</td><td>abc</td><td>def</td>
<tr>
<!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">
<head>
<title>jQuery控制table表格中Radio选中变色</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>