Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 802113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:33:00+00:00 2026-05-14T23:33:00+00:00

How do I create an HTML button that acts like a link? So that

  • 0

How do I create an HTML button that acts like a link? So that clicking the button redirects the user to a page.

I want it to be accessible, and with minimal extra characters or parameters in the URL.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T23:33:00+00:00Added an answer on May 14, 2026 at 11:33 pm

    HTML

    The plain HTML way is to put it in a <form> wherein you specify the desired target URL in the action attribute.

    <form action="https://google.com">
        <input type="submit" value="Go to Google" />
    </form>
    

    If necessary, set CSS display: inline; on the form to keep it in the flow with the surrounding text. Instead of <input type="submit"> in above example, you can also use <button type="submit">. The only difference is that the <button> element allows children.

    You’d intuitively expect to be able to use <button href="https://google.com"> analogous with the <a> element, but unfortunately no, this attribute does not exist according to HTML specification.

    CSS

    If CSS is allowed, simply use an <a> which you style to look like a button.

    <a href="https://google.com" class="button">Go to Google</a>
    
    a.button {
        padding: 1px 6px;
        border: 1px outset buttonborder;
        border-radius: 3px;
        color: buttontext;
        background-color: buttonface;
        text-decoration: none;
    }
    

    Or pick one of those many CSS libraries like Bootstrap.

    <a href="https://google.com" class="btn btn-primary">Go to Google</a>
    

    Noted should be that, historically, the CSS appearance:button property worked as well in some browsers, but this was experimental and ended up being considered a misfeature. Only none or auto are allowed on <a> elements.

    JavaScript

    If JavaScript is allowed, set the window.location.href.

    <input type="button" onclick="location.href='https://google.com';" value="Go to Google" />
    

    Instead of <input type="button"> in above example, you can also use <button>. The only difference is that the <button> element allows children.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 490k
  • Answers 490k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer First of all, it's a really bad idea to use… May 16, 2026 at 9:17 am
  • Editorial Team
    Editorial Team added an answer If you are not dead set on using a listbox,… May 16, 2026 at 9:17 am
  • Editorial Team
    Editorial Team added an answer killproc will terminate programs in the process list which match… May 16, 2026 at 9:17 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

In this page there's a way to dynamic add html (textbox,input button and radio
Let's say you create a wizard in an HTML form. One button goes back,
I have a button that will create a new entry (row in a table)
How can I create a button that will scroll to the next jQuery tab.
I'm using a Facebook-like autocomplete jquery library found at: http://otisbean.com/dropbox/jquery.tokeninput.js In my own html
I'm trying to create a particular CSS button described here: http://www.2shared.com/file/5131551/412bd8a8/Sans_titre-1_copie.html Basically, it's a
Within a form I have a button that launches a cfwindow, then presents a
I have a strictly browser based JavaScript and xlst application. It's normally used on
I have an Excel report with a bunch of sheets, each with a table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.