Base href 属性

定义和用法
href 属性可设置或返回页面中所有链接的基准 URL。
语法
baseObject.href=URL
浏览器支持
所有主要浏览器都支持 href 属性
实例
下面的例子可返回页面的基准 URL::
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>蜜蜂教程(mifengjc.com)</title> <base id="htmldom" href="https://www.mifengjc.com/js-ref/"> </head> <body> <p>基础URL 是: <script> document.write(document.getElementById("htmldom").href); </script> </p> </body> </html>
