【发布时间】:2019-02-03 08:00:53
【问题描述】:
这是我的 jquery 代码;但它给了我(未定义)。
$(document).ready(function(){
$('.items > tbody > tr').click(function() {
var src = $(this).find('a[title="View"]').attr('src');
alert (src)
});
});
HTML 代码是:
<table class="items">
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<a title='View' src="main.php"></a>
<a title='find' src="index.php"></a>
</tr>
</tbody>
【问题讨论】:
-
请发布更多的html,包括
.itemsclass。