<html>
<head>
<base id="myBase" target="_self" >
</head>
<body>
<p>Click the button to return the value of the target attribute of the base element.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myBase").target;
document.getElementById("demo").innerHTML = "Base target for all links: " + x;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_base_target by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 18:16:49 GMT -->
</html>