索引 0 中值为 #text 的数组是什么意思?
What does an array with the value #text in the index 0 mean?
在索引 0 中具有值 #text 的数组是什么意思它是从哪里来的?
我在下面解释了我的意思。
这是HTML代码:
<div class="todo-container">
<div class="todoList">
</div>
</div>
这是 JS 代码:
const todoList = document.querySelector(".todoList");
//function
function filtersTodo(e) {
const todos = [... todoList.childNodes];
console.log(todos);
}
这就是它显示给我的输出:img of output console.log(todos)
another picture
我的问题是数组 [#text] 从何而来,为什么?
“DOM 中的所有内容都由一个节点表示。包括纯文本。”
看到这个post:
在索引 0 中具有值 #text 的数组是什么意思它是从哪里来的? 我在下面解释了我的意思。
这是HTML代码:
<div class="todo-container">
<div class="todoList">
</div>
</div>
这是 JS 代码:
const todoList = document.querySelector(".todoList");
//function
function filtersTodo(e) {
const todos = [... todoList.childNodes];
console.log(todos);
}
这就是它显示给我的输出:img of output console.log(todos)
another picture
我的问题是数组 [#text] 从何而来,为什么?
“DOM 中的所有内容都由一个节点表示。包括纯文本。”
看到这个post: