<html>
<body>
<h1>JavaScript String Methods</h1>
<h2>The anchor() Method</h2>
<p id="demo1"></p>
<p>The anchor() method is deprecated in JavaScript.</p>
<p>Use the a tag instead:</p>
<p id="demo2"></p>
<script>
let text = "Hello World!";
let result = text.anchor("Chapter 10");
document.getElementById("demo1").innerHTML = result;
result = "<a name='Chapter 10'>" + text + "</a>";
document.getElementById("demo2").innerHTML = result;
</script>
</body>
</html>