No more need to have in a page to use hashlinks
You can install Hashlink via npm:
npm install thehashlink
Alternatively, you can include it directly in your HTML file:
<script src="https://unpkg.com/thehashlink@1.0.1/dist/bundle.js"></script>
Create instance
const hashlink = new Hashlink({ scroll: "smooth" });
new Hashlink({scroll: "smooth"}): Creates a new instance of the Hashlink class and sets smooth scrolling behavior.
hashlink.goto("id"):
hashlink.new("name"):
hashlink.setbyclass("classname", "id"):
hashlink.setbyname("name", "id"):