Home > Back-end >  How can I add an href to a preexisting button so that it will scroll to an id on a webpage?
How can I add an href to a preexisting button so that it will scroll to an id on a webpage?

Time:01-27

I keep trying things that don't work or break it in some other way.

<p ><p ><a  href="bookAtable">Get Started</a></p>

I want the button to scroll the bookAtable id, but I don't know to hook up the button and the scroll function to the "Get Started" text at the same time

CodePudding user response:

All you need is to add a # before bookAtable in the href

<a href="#bookAtable">Click</a>

CodePudding user response:

you need a # before bookAtable, so it would look like href="#bookAtable"

  •  Tags:  
  • Related