javascript - 在 chrome 的控制台中显示 HTMLInputElement
问题描述
我想显示 HTML 输入的 HTMLInputElement 对象:
<div>
<input type="text" id="name" name="toto" value="test" />
</div>
JS脚本:
<script>
const inputEl = document.getElementById("name");
console.log(inputEl);
</script>
在 chrome 控制台中,我得到了这个:
但我想将它显示为 HTMLInputElement 对象。
在 stackblitz 控制台中,我得到了对象:
谢谢 :)
但是在本地我没有得到对象!
解决方案
不是 100% 确定您所说的“显示为 HTMLInputElement”是什么意思。如果您想查看其所有字段,您可能需要使用console.dir(inputEl)
.
推荐阅读
- doctrine-orm - Doctrine 中的 getScalarResult 和 getArrayResult 有什么区别
- css - 水平翻转 SVG 内的元素但保持其原始位置
- opencv - 如何使用写轮眼进行报纸文本提取?
- javascript - 为什么php执行header语句而不执行echo语句
- vim - Vim 仅在删除另一个缓冲区时才删除缓冲区
- html - Rvest:导航 html 节点
- java - PDF Box:从 PDF 文档中提取图像并保持图像方向
- oracle-sqldeveloper - 在 Oracle 应用程序 r12 中为 IR-ISO 流程创建收据
- python - python 运算符 = 和 == 计数器
- r - 使用 pivot_longer 转换多行