Tryit Editor v1.8

Source Code:
<!DOCTYPE html> <html> <body> <p><a href="#C6">See also Chapter 6</a></p> <h2>Chapter 1</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 2</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 3</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 4</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 5</h2> <p>This chapter explains ba bla bla</p> <h2><a id="c6" name="C6">Chapter 6</a></h2> <p>This chapter explains ba bla bla</p> <script> document.write("Return name of anchor: "); document.write(document.getElementById("c6").name); </script> </body> </html>
Result:
W3Schools.com - Try it yourself