zachary Posted May 5, 2006 Share Posted May 5, 2006 how to I make a button a link? Link to comment Share on other sites More sharing options...
scott100 Posted May 5, 2006 Share Posted May 5, 2006 <input type="button" value="button" onclick="window.location='http://www.google.com'" /> Link to comment Share on other sites More sharing options...
zachary Posted May 5, 2006 Author Share Posted May 5, 2006 thanks scott Link to comment Share on other sites More sharing options...
jojay Posted May 5, 2006 Share Posted May 5, 2006 Or you can do like the one below: <html><head><title>Button Link</title><script Language="javascript">function link() { window.location = "http://www.somesite.com"; }</script></head><body><form><input type="button" name="button" value="Click Button" onclick="link()"></form></body></html> Link to comment Share on other sites More sharing options...
Little Goat Posted May 6, 2006 Share Posted May 6, 2006 that is practically the same thing, only put inside a function.LG Link to comment Share on other sites More sharing options...
justsomeguy Posted May 6, 2006 Share Posted May 6, 2006 You can also make a pretty convincing button out of a normal anchor tag: .menu_item { background-color: #B0B0B0; color: #600000; font-size: 11px; font-weight: bold; font-family: sans-serif; border: 2px outset #000000; padding: 2px; display: block; } .menu_item:hover { background-color: #C1BCB1; color: #FFFFFF; border: 2px inset #000000; } <div style="width: 150px;"><a href="menu.php" class="menu_item" id="menu_item_home">Home</a></div> Link to comment Share on other sites More sharing options...
Jack McKalling Posted May 6, 2006 Share Posted May 6, 2006 You can also simply submit a form that does not post anything; <form action="your_link.php" method="post"><button type="submit">Click here</button></form> Link to comment Share on other sites More sharing options...
justsomeguy Posted May 8, 2006 Share Posted May 8, 2006 True, I made a whole menu out of those once. Works great. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now