HTML DOM tagName 属性
最后更新于:2022-03-26 22:13:58
HTML DOM tagName 属性
元素对象
实例
获取元素的标签名:
document.getElementById(“demo”).tagName;
输出结果:
P
尝试一下 »
定义和用法
tagName 属性返回元素的标签名。
HTML 返回 tagName 属性的值是大写的。
浏览器支持





所有主要浏览器都支持 tagName 属性
语法
技术细节
返回值: |
字符串,代表元素的标签名 |
DOM 版本 |
Core Level 1 Element Object |
元素对象