Jump to content

Link Push Button


Mori
 Share

Recommended Posts

You can just put it in a form with the action to the page:

<form action="page.html" method="get"><input type="submit" value="Click here"></form>

Then there's the Javascript way, which is less accessible:

<input type="button" value="Click here" onclick="window.open('page.html')">

Forms have a margin by default, you can remove it with CSS:

form { margin: 0; }

Link to comment
Share on other sites

Thanks so much for the answer!The following code is what I was looking for. However it doesn't open the desired page in a new tab/window:<form action="page.html" method="get"><input type="submit" value="Click here"></form>Any fix?
Oh, that's right. You'll need a Transitional DTD to use this: Add target="_blank" to the <form> element.
Link to comment
Share on other sites

Sorry to bother you, but there are two strange problems when using the button in Chrome and Safari:-There is an extra question mark in front of the target page URL, e.g. page.html/?-The button doesn't work more than onceI never thought something so simple can get so tricky. :)Thanks anyway!

Link to comment
Share on other sites

The question mark doesn't affect anything, really. But you can remove it by changing method to post.It's strange that the button won't work more than once, I don't see why it shouldn't. I've never tried using forms with the target attribute before.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...