Ali Zia Ali Zia - 4 months ago 5x
Javascript Question

Can I use a <button> instead of <a> to go to #location?

I have this code.

<li class="active">
<a href="#tab-weekly" data-toggle="tab">Weekly Payment</a>
<a href="#tab-advance" data-toggle="tab">Advance Payment</a>
<a href="#tab-data" data-toggle="tab">Expenses</a>

My question is that can I use
instead of
to achieve this? I changed it to buttons but they are not working.


Yes. Use <button type="button" onclick="window.location.href='YOUR URL HERE'">Link Text</button>