Use window.location.hash
to grab the anchor's name.
var anchorName = window.location.hash;
Create a text node to display what you want:
var path = document.createTextNode("→ " + anchorName);
Add it to the Dom:
document.getElementById(idOfContainerYouWantToEdit).appendChild(path);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.