穿上調用其輸入子元素click
八九不離十工作的行單擊事件處理程序。嘗試一下這裏:http://jsfiddle.net/59p9s/
<script type="text/javascript">
function handleRadioRow() {
var t = event.target;
if (t.tagName.toUpperCase() == "INPUT")
return;
while (t.tagName.toUpperCase() != "TR")
t = t.parentElement;
var r = t.getElementsByTagName("input")[0];
r.click();
}
</script>
<table>
<tr onclick="handleRadioRow()" style="cursor: pointer;">
<TD><INPUT type="radio" name="Radios" value="someValue"></td>
<TD>someValue</td>
</tr>
<tr onclick="handleRadioRow()" style="cursor: pointer;">
<TD><INPUT type="radio" name="Radios" value="someValue"></td>
<TD>someValue</td>
</tr>
</table>