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
  • 55,805
  • 14
  • 125
  • 143
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
  • 827
  • 8
  • 16