Jquery 单击可以变色,但是如果点在连接上却不能打开连接 本帖最后由 dydxf 于 2010-03-04 12:26:58 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <tr onclick="javascript:window.location.href='test.asp'"><td>asd</td></tr> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><base href="http://docs.jquery.com" /><script src="http://code.jquery.com/jquery-latest.js"></script> <script>window.onload = (function(){ $(".tablesorter tbody tr").toggle( function (){ $(this).addClass("clickColor") }, function (){ $(this).removeClass("clickColor") } ); $(".tablesorter tbody tr td a").each(function(){ $(this).click(function(){ document.location.href=this.href; }); });});</script><style> .clickColor { background:yellow; } </style><style>html,body{border:0; margin:0; padding:0;}</style></head><body><table class="tablesorter"><tr><td>1</td><td><a href="11">1111</a></td></tr><tr><td>2</td><td><a href="22">2222</a></td></tr><tr><td>3</td><td><a href="33">3333</a></td></tr></table></body></html> js监听chrome关闭事件 在 IE 里不能 table.appendChild() 寻求熟悉YUI框架的JS高手 如何将这段代码加入一个.js文件中? 如何利用form.submit点下一页的时候,让表单提交,然后在下一页把数据获取,这样就实现了上一页的数据. js文件调用jQuery 请求高手给一个弹出窗口的代码,谢谢! 超级大难题,解决了送100分 请教:怎么在javascript里面表示<td nowrap>? 怎样让两个层叠放在一起,必要时候显示必要的一个呢? jquery函数嵌套中的变量问题 js 获取a标签的问题
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="http://docs.jquery.com" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
window.onload = (function(){
$(".tablesorter tbody tr").toggle(
function (){
$(this).addClass("clickColor")
},
function (){
$(this).removeClass("clickColor")
}
);
$(".tablesorter tbody tr td a").each(function(){
$(this).click(function(){
document.location.href=this.href;
});
});
});</script>
<style>
.clickColor { background:yellow; }
</style>
<style>html,body{border:0; margin:0; padding:0;}</style></head>
<body>
<table class="tablesorter">
<tr><td>1</td><td><a href="11">1111</a></td></tr>
<tr><td>2</td><td><a href="22">2222</a></td></tr>
<tr><td>3</td><td><a href="33">3333</a></td></tr>
</table>
</body>
</html>