<html>
<head>
<base id="htmldom" >
</head>
<body>
<p>Click the button to display the value of the href attribute of the base element.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("htmldom").href;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_base_href by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:40:39 GMT -->
</html>