我想用JavaScript處理TD中的內容,當TD內容改變時,我會做其他事情。但似乎變化事件永遠不會升起。 的HTML:HTML Table TD'change'事件無法提升?
<table><tr><td id='testTD'>Test</td></tr></table>
的JavaScript:
jQuery().ready(function(){
jQuery('#testTD').on('change', function(e){alert('td changed');});
jQuery('#testTD').append('something'); //why this did not raise the 'change' event for td?
});
任何想法?
您將如何更改'td'的內容?是否可編輯? –
使用jQuery,就像上面的'jQuery('#testTD')。append('something');' – aaron
爲什麼不''click'事件? –