HTML DOM isId 属性
最后更新于:2022-03-26 22:16:36
HTML DOM isId 属性
属性对象
实例
检查属性是否为元素的 ID 属性:
document.getElementById(“demo”).attributes[0].isId;
输出结果:
true
尝试一下 »
定义和用法
如果属性是 ID 类型(例如,包含了其所属的元素的标识符),则 isId 属性返回 true,否则返回 false。
浏览器支持





除了 Internet Explorer 和 Opera浏览器外,其他主流浏览器都支持isId 属性.
语法
技术细节
返回值: |
Boolean, true|false
|
DOM 版本 |
Core Level 3 |
属性对象