Skip to navigation
Internal link to a page with # with javascript
27.10.25
``` if (location.hash) { const id = decodeURIComponent(location.hash.slice(1)); const el = document.querySelector("#" + id); if (el) { el.closest("td").style.background = "red"; el.scrollIntoView({ behavior: "smooth", block: "start" }); } } ```
https://www.w3schools.com/html/html_links.asp
Reply
Anonymous
Information Epoch 1766523580
Save trees.
Home
Notebook
Contact us