📅  最后修改于: 2022-03-11 15:04:05.959000             🧑  作者: Mango
// You need to add the event listener when the element is created.
function createEventListener() {
var node = document.createElement('div');
if (node) {
node.addEventListener('click', function() {
console.log('Clicked Node');
});
} else {
console.error('No node');
}
}