1
單擊某個元素時,我無法觸發某個事件,並且此元素僅在懸停td元素時纔會顯示。單元上的單擊事件(僅在懸停時顯示)未觸發
//Hovering over a td element displayed a Span
$('td').hover(
function() {$(this).append('<span class="editCell">hello</span>')},
function() {$(this).find('span:last').remove()}
)
//Clicking on that span, it's supposed to trigger alert. But it doesn't.
$('.editCell').click(function(){
alert('hello');
})