How does in-page anchor jump solve the PROBLEM of URL changes
January 11, 2024
by Yashvi Jaggi
No Comments
Instead of the A tag, or instead of the href, we bind the button we want to click to a click event, what does that click event need to do? Look at the code below!
// Bind the event to the element you want to click and pass in the id of the element you want to jump to // since the project uses Vue, just say @click < a@click ="changeHash('#box2')"ChangeHash (idName) {document.QuerySelector (idName).scrollinToView (true);
}Copy the code