Ali Zia Ali Zia - 10 months ago 27
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>