Document baseURI Property - Javascript DOM

Javascript examples for DOM:Document baseURI

Description

The baseURI property returns the base URI of the HTML document.

This property is read-only.

Return Value

A String, representing the URI of the node's page

The following code shows how to get the baseURI of the document:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {/*from   w w  w. j  a v  a 2  s  .  c  o  m*/
    var x = document.baseURI;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials