我在选择 DOM 上的元素时遇到问题。
td类垃圾桶的所有链接如何选择?
<td class="trash_can">
<a rel="nofollow" data-remote="true" data-method="delete" data-confirm="Are you sure you want to delete Greek Theater at U.C. Berkeley?" href="/promotions/2/places/46">
<img id="trash_can" src="http://test.dev/images/trash.png?1305741883" alt="Trash">
以下代码不执行任何操作且无法正常工作:
$(function(){
$('.trash_can').live("click", function(event) {
console.log('Clicked Delete');
event.preventDefault();
});
});