腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
搜索
关闭
文章
问答
(624)
视频
开发者手册
清单
用户
专栏
沙龙
全部问答
原创问答
Stack Exchange问答
更多筛选
回答情况:
全部
有回答
回答已采纳
提问时间:
不限
一周内
一月内
三月内
一年内
问题标签:
未找到与 相关的标签
筛选
重置
4
回答
创建
HTMLCollection
我正在尝试填充应该返回的然而,//TypeErrror:
HTMLCollection
is not a constructor和h[0] = div;// Could not convert JavaScriptargument除了填充
HTMLCollect
浏览 4
提问于2011-10-13
得票数 12
回答已采纳
1
回答
如何洗牌
HTMLCollection
我有一个页面,它加载由1000个元素组成的
HTMLCollection
。 我想要实现的是,一旦页面加载,紧接着,我希望
HTMLCollection
被洗牌。应该将
HTMLCollection
复制到另一个临时变量中,删除现有
HTMLCollection
中的所有项(在DOM上),对该临时项进行洗牌并显示它--在这种情况下,如何删除
HTMLCollection
项或者是否有可能按原样操作
HTMLCollection
和DOM --在这种情况下是如何实现的?
浏览 1
修改于2019-08-18
得票数 0
回答已采纳
1
回答
HTMLCollection
对象扩展?
我发现HTMLOptionsCollection对象继承了
HTMLCollection
的属性和方法。HTMLOptionsCollections->
HTMLCollection
->Object->null 是否还有其他类型也继承了
HTMLCollection
?
浏览 12
提问于2012-04-12
得票数 3
回答已采纳
1
回答
HTMLCollection
混淆
如果我打电话给document.getElementsByClassName('cl'),我就会得到一个
HTMLCollection
。写道,
HTMLCollection
是一个历史工件,尽管我似乎找不到任何建议的替代物(什么是“元素”?) 那么,我应该检查返回的对象是否确实是HTMLElement吗?还能是什么?什么时候?
浏览 2
提问于2015-10-25
得票数 0
回答已采纳
1
回答
克隆
HTMLCollection
我发现变量类型是
HTMLCollection
,但我不知道如何克隆它或将它分配给一个新变量。
浏览 2
提问于2021-03-21
得票数 0
回答已采纳
2
回答
Javascript [object
HTMLCollection
]
);localStorage.setItem("myNodelist", document.getElementsByTagName("LI")); 没有,它只是返回[object
HTMLCollection
浏览 1
修改于2020-01-25
得票数 0
回答已采纳
1
回答
HTMLCollection
和NodeList
但我尝试了一下getElementsByTagName,它似乎能抓取所有内容并将其放入
HTMLCollection
中。然而,HTML集合的长度为0。length似乎不能工作,我也不习惯
HTMLCollection
,这似乎就是我所得到的。
浏览 0
提问于2013-01-19
得票数 0
回答已采纳
1
回答
从
HTMLCollection
输出所有项目
我有一个从字符串转换而来的
HTMLCollection
: el.innerHTML = data; // This data如何实际显示
HTMLCollection
中的所有元素?我必须遍历
HTMLCollection
吗?另外,是否有必要将
HTMLCollection
转换为数组?
浏览 28
修改于2019-08-17
得票数 1
2
回答
无法获得
HTMLCollection
长度
我的页面上有几个动态创建的列表元素,我现在的目标是使用getElementsByTagName访问页面上的所有getElementsByTagName,但是当我尝试这样做时,控制台告诉我,我的li数组的长度是0。这是我的代码:window.addEventListener('DOMContentLoaded', function() { let content = docu
浏览 1
修改于2019-06-11
得票数 0
回答已采纳
2
回答
如何遍历
htmlcollection
对象?
我已经看过这里关于
htmlcollection
的几乎每一个问题。 所以我有一个div,我正在使用ajax在这个div中获取数据并创建div,所以它们不是硬编码的。我尝试了几乎所有的方法来循环这个
htmlcollection
,但是它不起作用。.});
HTMLCollection
.prototype.forEach
浏览 262
修改于2020-12-12
得票数 1
回答已采纳
2
回答
如何在元素的
HTMLCollection
中呈现[object
HTMLCollection
].length?
我想要展示的是,
HTMLCollection
是一个活动列表,NodeList是静态的。为此,我将页面上的div总数存储在每个变量中(g表示HTML,q表示Node),即1。
浏览 6
修改于2021-07-26
得票数 0
回答已采纳
1
回答
javascript
HTMLCollection
访问
console.log(SelectedItem); } 我通过Firebug显示控制台,它显示给我看
HTMLCollection
浏览 4
修改于2014-05-28
得票数 4
回答已采纳
1
回答
如何观察
HTMLCollection
?
我有点好奇,因为我知道HTMLCollections会自动更新自己,所以我尝试使用来观察它们,如下所示 set: (target, prop, value, reciever) => { // apply default behaviour } // t
浏览 5
提问于2021-06-12
得票数 4
回答已采纳
2
回答
无法解析
HTMLCollection
列表
当我console.log myChildList (即HTMLElement的子级)时,我得到了类似于
HTMLCollection
a.下拉项目的内容,其中长度为2,同时带有锚标记,并在其中包含所有属性和链接当我想使用循环console.log所有元素时,它只显示一个元素,输出如下所示:我不明白我在解析
HTMLCollection
浏览 1
修改于2021-01-04
得票数 0
回答已采纳
1
回答
为什么
htmlCollection
不从数组继承
为什么
htmlCollection
不从数组继承?我知道
htmlCollection
是一个实时集合,而不是一个快照数组,但它不能继承数组吗?这两个问题的区别是,是‘差别是什么’,我的问题是‘为什么有差异’。
浏览 3
修改于2017-05-23
得票数 1
回答已采纳
1
回答
为什么
HTMLCollection
中的元素与
HTMLCollection
.item()返回的内容不同
例如,在Chrome工具中,如果我使用:我得到一个
HTMLCollection
,如您所见,0-indexd属性表示一个典型的对象我的问题是,为什么item()方法不返回
HTMLCollection
中的同一个对象?据我理解,
HTMLCollection
是一个对象,从item()方法中检索的是对象的属性,因此它们应该是相同的。
浏览 0
提问于2018-04-20
得票数 0
回答已采纳
2
回答
如何处理
HTMLCollection
{}?
我使用JSDOM来设置用于处理的html。 const dom = new JSDOM(input) for (let x of tables) { if (x.getElementsByTagName('tr').length === 1) { const test = [...x.getElementsByTagNam
浏览 4
修改于2021-08-30
得票数 0
回答已采纳
2
回答
我无法访问
HTMLCollection
使用getElementsByClassName时无法访问
HTMLCollection
类型。parent.document.all['header']; var motionClass = documentHeader.getElementsByClassName('motion'); 这是motionClass的结果
HTMLCollection
浏览 51
提问于2018-12-26
得票数 2
回答已采纳
1
回答
在
HTMLCollection
上迭代
我有一个脚本,其中包含所有使用
HTMLCollection
标记的HTML节点。即使
HTMLCollection
.nodeItem(index)接口返回undefined,我也能看到这些“额外”属性的内容。 我已经尝试过for..of, for..in,但这些都没有记录。
浏览 0
提问于2018-04-19
得票数 0
6
回答
HTMLCollection
元素的For循环
我正在尝试设置HTMLCollectionOf中所有元素的get id。我写了以下代码:console.log(list[0].id); console.log(key.id);但我在控制台中得到了以下输出:undefined
浏览 440
修改于2019-01-08
得票数 553
回答已采纳
第 2 页
第 3 页
第 4 页
第 5 页
第 6 页
第 7 页
第 8 页
第 9 页
第 10 页
第 11 页
点击加载更多
领券