如何响应html table中每个td的click事件呢?如果是使用Jquery的话,可以像下面这样做。
html table 截图
html table 源代码
41111111111xqHBhlAOrgvOrjinking.xu2015-09-21 17:50:012015-09-21 17:50:013adminXsuZWohjMSIeP2015-09-16 15:44:372goods.vipgsFpUzoJfwtNejilin.lu2015-09-15 15:29:062015-09-16 15:44:051b2csupport_huiguiLWJGxnqSyOjXd2015-09-16 15:44:37Jquery源代码
$("input[name='toEdit']").each(function(){
var currentEle = $(this);
currentEle.click(function(){
window.location.href="${basePath}v/xxx/toEdit/?systemId="+$(this).attr("systemIdVaule");
});
});
在这里使用了一个自定义属性systemidvalue,目的是为了存储数据库主键id。当然如果你在
中加入onclick也是可以的,使用方式不同而已。