这是我在dom中创建Note的函数,问题是在Note创建中我添加了类动画“淡入”,当这个函数运行时,它为所有Note dom创建动画,而不是只为一个创建。我怎样才能修复它,只有一个创建将做动画?
function createNote(note){
const noteContainer = document.querySelector("#note-display");
let noteEl = `<div id="${note.id}" class="note fade-in">
<span onclick="removeNote(this)" class="remove-container">
<i class="fa fa-remove"></i>
</span>
<textarea onchange="updateMessage(this)">${note.message}</textarea>
<p>${note.date}</p>
<p>${note.time}</p>
</div>`
noteContainer.innerHTML += noteEl;
console.log(noteContainer.innerHTML)
}```
这是因为您正在调整NoteContainer的
有关该函数的更多信息请访问:https://developer.mozilla.org/en-us/docs/web/api/node/appendchild