1 Answers
I assume "enclosed text of the target anchor" refers to the id of the target element, and that "hyperlink text" is the text displayed in the element. The best way of doing this would be either to generate the table of contents on the server side using a language such as PHP, or with Javascript that sets the text by reading the value in "href" attribute of the element, then setting the "innerText" property accordingly. A simple CSS workaround could also be used with the ::after selector by setting it's "content" property to "attr(href)," though this would leave a "#" symbol in the displayed text.
4 views
Answered