The <script> element is employed to declare client-side JavaScripts.
The subsequent JavaScript code writes “Hello JavaScript!” into an HTML element identified by id=”demo”:
Example
<script> function myFunction() { document.getElementById(“demo”).innerHTML = “Hello JavaScript!”; } </script> |
The <base> element defines the base URL and/or target for all relative URLs within a page.
The <base> tag must contain either an href attribute, a target attribute, or both.
A document can contain only a single <base> element.
Example
Define a default URL and target for all links within a page:
<head> <base href=”https://www.code7school.com/” target=”_blank”> </head> <body> <img src=”images/stickman.gif” width=”24″ height=”39″ alt=”Stickman”> <a href=”tags/tag_base.asp”>HTML base Tag</a> </body> |