.... <div id="top"> ..... ..... <a href="#top">Jump to the top of the page</a> ....
<a href="[[~[[*id]]]]#top">Jump to the top of the page</a>
You need to explicitly specify the entire URLYes, set the entire URL can make it work.
<a href="[[~[[*id]]]]#top">Jump to the top of the page</a>
Ah. No, something that is done by javascript in the browser won't work, since the tags have to be processed by MODx on the server. If the link is generated by Javascript, you'll have to use whatever Javascript does to output the current page's URL, such as window.location.href or document.URLYour analysis is very clear, for my situation, I will select the Javascript way to do this now.