<base href='https://www.plus2net.com/images/' target='_blank'>
| Attribute | Description |
|---|---|
| href | The URL to be userd , can be relative or absolure |
| target | _self : Default, loaded in same browser window _blank: Open in new window _parent: If curent one is a child window then link will open in Parent _top: Open in ancestor of present one ( if exist ) |
<base href=../php_tutorial/ target=_blank>
<a href=site_map.php>Go to PHP Section</a>
<base href=../images/>
In our present directory , inside this page we have image URL like this.
<img src=logo.jpg>
Output is here <base href=https://www.plus2net.com/images/>
<script>
var base_URL = document.baseURI;
alert(base_URL); // https://www.plus2net.com/html_tutorial/html-base-url.php
alert(window.location.origin) // https://www.plus2net.com
alert(window.location.host) // www.plus2net.com
</script>
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.