<html>
<body>
<script id="myScript" src="demo_script_src.js"></script>
<p>Click the button to get the URL of the external script file.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myScript").src;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>