-1

How Can I Have A Hyper Link That Takes Me To An HREF #ID Upon The Click Of A Button? I was initially trying to surround the button with an tag but that wasn't working

AshFries
  • 1
  • 2
  • try W3School or google for `ID location via href` – dhpratik Sep 21 '22 at 06:01
  • you mean an . – Crystal Sep 21 '22 at 06:02
  • Please visit the [help], take the [tour] to see what and [ask]. Do some research - [search SO for answers](https://www.google.com/search?q=html+button+links+to+id+on+page+site:stackoverflow.com). If you get stuck, post a [mcve] of your attempt, noting input and expected output using the [\[<>\]](https://meta.stackoverflow.com/questions/358992/ive-been-told-to-create-a-runnable-example-with-stack-snippets-how-do-i-do) snippet editor. – mplungjan Sep 21 '22 at 06:04

1 Answers1

-1

<a href="http://example.com/page.html#foo">Jump to #foo on page.html</a> will help you out. There should be a unique id on your page with the name foo to it.

if on the same page try <a href="#foo">Jump to #foo on same page</a>

There you can navigate without any hassles

dhpratik
  • 1,100
  • 4
  • 19
  • 43