<!DOCTYPE html>
<html>
<body>
<p><a id="myAnchor" href="../../www.example.com/test.htm#part2">Example link</a></p>
<p>Click the button to change the text content of the link above.</p>
<p><b>Note:</b> This example only works in Internet Explorer 10 (and higher) and Firefox.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.getElementById("myAnchor").text = "Click me to open example link!";
}
</script>
</body>
</html>