How to make a button redirect to another page using jQuery or just Javascript

Ankur picture Ankur · Feb 10, 2010 · Viewed 480.1k times · Source

I am making a prototype and I want the search button to link to a sample search results page.

How do I make a button redirect to another page when it is clicked using jQuery or plain JS.

Answer

Reigel picture Reigel · Feb 10, 2010

is this what you mean?

$('button selector').click(function(){
   window.location.href='the_link_to_go_to.html';
})