<html>
<head>
<base id="myBase" >
</head>
<body>
<p>Click the button to set the value of the target attribute of ALL links on a page to "_blank".</p>
<p><a href="../index.html">W3Schools</a></p>
<p><a href="../index.html">W3Schools</a></p>
<p><b>Note:</b> Try the links before and after you have clicked the button!</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("myBase").target = "_blank";
document.getElementById("demo").innerHTML = "The value of the target attribute was set.";
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_base_target2 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:17:09 GMT -->
</html>