标签:back fun nbsp col 其它 section class scripts .text
1 <table class="table table-bordered "> 2 <tr class="control-label"> 3 @for (int i = 0; i < 5; i++) 4 { 5 <th>ColumnName_@i</th> 6 } 7 </tr> 8 @for (int i = 0; i < 10; i++) 9 { 10 <tr> 11 @for (int j = 0; j < 5; j++) 12 { 13 <td><a href="#" onclick=‘GetOtherTDValue(this)‘>ColumnValue_@i@j</a></td> 14 } 15 </tr> 16 } 17 </table> 18 19 @section scripts{ 20 <script type="text/javascript"> 21 function GetOtherTDValue(td) { 22 var parentTR = td.parentNode.parentNode; // 获取当前 A 标签所在的TR 23 var firstTd_value = $(parentTR).children(‘td‘).eq(0).text(); //获取TR 标签下第一个TD 标签的值 24 alert(firstTd_value); 25 } 26 </script> 27 }
标签:back fun nbsp col 其它 section class scripts .text
原文地址:https://www.cnblogs.com/allenzhang/p/10130692.html