let mObserver = new MutationObserver((mutationsList, observer) => {
mutationsList.forEach((mutation) => {
if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
mutation.addedNodes.forEach((node) => {
console.log(node)
})
}
})
})
mObserver.observe(document.body, {
childList: true,
subtree: true
})
我怎么知道添加的node
的类型?我只想定位a
标签