当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM id属性
The id property sets or returns the id of the <base> element.
id属性可设置或返回<base>元素的id值
baseObject.id=id |
The following example returns the base id:
返回base的id值:
<html> <head> <base id="myBaseId" href="http://www.ruanchen.com/tech/school/htmldom/" /> </head> <body> <p>Base id: <script type="text/javascript"> x=document.getElementsByTagName('base')[0]; document.write(x.id); </script> </body> </html> |
Output:
输出
Base id: myBaseId |
Get the base id of an HTML document
得到HTML文档的基础id