-1

How do I create a page which has a button, which onclick() will redirect to another page?

Hadi
  • 36,233
  • 13
  • 65
  • 124
Bugzy216
  • 1
  • 1
  • This question is asking multiple questions at once. 1) How do I send a request when a button is clicked. 2) How do I respond to the request and redirect to a new page. – Adam Zerner Apr 15 '17 at 19:38

1 Answers1

0

This would go to www.stackoverflow.com You can substitute anything for that of course.

In HTML:

button(onclick='redirect(www.stackoverflow.com)') Button!

In JS:

function redirect(res){
      window.location = res;
    }
Glen Pierce
  • 4,401
  • 5
  • 31
  • 50