Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create an HTML button that acts like a link to an item on the same page?

I would like to create an HTML button that acts like a link to an item on the same page. So, when you click the button, it redirects to item on the same page.

How can I do this? (I would limit the solution to HTML, CSS, and JavaScript, because currently I am not using any other language)

Current Button (Bootstrap):

<a class="btn btn-large btn-primary" href="">Democracy</a>
like image 798
itmilos Avatar asked Jun 29 '13 01:06

itmilos


1 Answers

Try:

<button onclick="window.location.href='location'">Button Name</button
like image 54
Mohammad Areeb Siddiqui Avatar answered Nov 23 '22 15:11

Mohammad Areeb Siddiqui