【发布时间】:2018-08-23 06:14:27
【问题描述】:
我想尝试在 Chrome 的控制台面板中设置属性。
但不使用鼠标。像这样的例子: https://developers.google.com/web/updates/2015/08/edit-html-in-the-console-panel
我希望只写带有命令的JS-CODE,例如:
document.querySelectorAll(".serial-number").setAttribute("Value","dummy");
在控制台面板 Chrome 中,此功能 setAttribute 不可用。请问有没有其他方法可以通过设置属性来编写代码?
【问题讨论】:
-
为什么要在元素集合上设置属性?我不知道集合对属性有什么用。
标签: javascript console panel setattribute