admin管理员组文章数量:1289525
I am having table which contain some data. This table is generating using a ponent. All td's has the same class name. Each row begins with a check-box with a specific value to that row. When click on a td on that row I want to get check-box value. When I click on a label JavaScript function is triggered. Cannot use jQuery click function.
I am having table which contain some data. This table is generating using a ponent. All td's has the same class name. Each row begins with a check-box with a specific value to that row. When click on a td on that row I want to get check-box value. When I click on a label JavaScript function is triggered. Cannot use jQuery click function.
Share Improve this question edited Dec 4, 2022 at 11:33 Brian Tompsett - 汤莱恩 5,89372 gold badges61 silver badges133 bronze badges asked Sep 21, 2011 at 12:51 YasithaYasitha 1112 gold badges3 silver badges10 bronze badges 2- 2 Your post looks more like a list of requirements than an actual question. Did you try anything? Are you looking for help with a specific topic, and if so, which one? – Frédéric Hamidi Commented Sep 21, 2011 at 12:53
- Why can't you use a jquery click function? – JNDPNT Commented Sep 21, 2011 at 12:53
2 Answers
Reset to default 6sample: http://jsfiddle/gCGVJ/
$('td').click(function() {
alert($(this).closest('tr').find('input[type=checkbox]').val());
});
$('td').click(function(){
var val = $(this).closest('tr').find('#checkbox').val();
});
本文标签: jqueryGet the closest tr value in JavaScript functionStack Overflow
版权声明:本文标题:jquery - Get the closest tr value in JavaScript function - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741414884a2377452.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论