1

I have created a button on Dreamweaver,

Using Dreamweaver, How can I make button take the user to another page on click?

This is the link for the button:

<input type="submit" value="Submit">
Chris Hapeshis
  • 83
  • 1
  • 11

1 Answers1

0

You can use one of the following:

<input type="button" value="Submit" onclick="javascript:window.location.assign("http://google.com");">

A more modern equivalent is:

<button onclick="javascript:window.location.assign("http://google.com");">
  Submit
</button>

Hope this helps!

SteJ
  • 1,491
  • 11
  • 13
  • This is a bad approach! It will work, but it is not good practice. Use `a` tags for links. Style the as buttons if need be but don't use a button and javascript. Buttons will not be activated by search engines, screen readers could struggle with them for visually impaired uses. Use the element that is made for this: `a` – Jon P Jul 30 '15 at 23:39
  • Yes, this is true, but it also wasn't the question - the question was specifically related to using a form element. – SteJ Jul 30 '15 at 23:54
  • You don't need `javascript:` for `onlick` attributes, that is for urls. –  Jul 31 '15 at 01:40