0

I'm wondering why my button is not working, this is my code:

<button type="button" a href="#dos">CONOCÉ SOBRE SU VIDA</button>

#dos is supposed to be an anchor tag with an id. What is it that I'm doing wrong?

Andrew Li
  • 51,385
  • 12
  • 117
  • 139
Nina
  • 5
  • 3

1 Answers1

0

You are creating a button with a href and a attribute, not an a element. If you want your button to act as a link to https://.../#dos, try this instead:

<button onclick="location.hash='dos'">Go to /#dos</button>
Kyle Lin
  • 817
  • 8
  • 16