Можно проще
function my_func(element, callback) {
const iterator = document.createNodeIterator(element, NodeFilter.SHOW_ALL);
let current;
while (current = iterator.nextNode()) {
callback (current);
}
}
https://developer.mozilla.org/en-US/...teNodeIterator
Последний раз редактировалось voraa, 31.08.2022 в 14:20.
|