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

  • SEARCH
  • Home
  • 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 7160265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:22:15+00:00 2026-05-28T13:22:15+00:00

What is the best way to make buttons(javascript) like this and what is the

  • 0

What is the best way to make buttons(javascript) like this and what is the correct tag? “a”, “b” or any other tag ?

Example – http://jsfiddle.net/S7FPH/

or

<html>
<head>
<style type="text/css">
a.a_button, b.b_button {
    margin: 10px;
    background-color: green;
    width: 100px; height: 20px;
    text-align: center;
    display: block;
    color: yellow;
}
a.a_button {text-decoration: none;}

b.b_button{
    cursor: pointer;
    font-weight: 100;
}
</style>

<script type="text/javascript">
    function test(){
        alert("test");
    }
</script>
</head>
<body>

<a class="a_button" href="" onclick="test(); return false;">click</a>

<b class="b_button" onclick="test();">click</b>

</body>
</html>

UPDATE:

Thats how it should look
People asked it depends on how i want to use it, so here is an example.

about “button” tag – is thear is a way to make “button” tag look similar to my example(design) ?
about “ul” – i like it but i dunno how to position it this way.

  • 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-28T13:22:16+00:00Added an answer on May 28, 2026 at 1:22 pm

    Write Unobtrusive JavaScript and use:

    • A link (<a href="fallback">…</a>) if you can fall back to a regular link if the JS doesn’t work
    • A submit button (<input type="submit"> or <button type="submit">…</button>) if you can fall back to a form submission if the JS doesn’t work
    • A basic button inserted into the DOM with JavaScript (<input type="button"> or <button type="button">…</button>) if there is no sensible fall back available.

    Your simplified example is too far divorced from whatever your real use case is to tell which of the above applies in this care.

    Note that all of the above are focusable for free. Using elements that aren’t designed to be interacted with requires adding focusability using tabindex (which isn’t supported in some older browsers) and without focusability you can only interact with them using a pointing device (such as a mouse) and not with a linear input device (such as a keyboard).

    Don’t use a bold element. That would be nonsense.

    People asked it depends on how i want to use it, so here is an example.

    That can fall back to links simply enough. You should also make use of pushState so you don’t break bookmarking.

    about “button” tag – is thear is a way to make “button” tag look similar to my example(design) ?

    Just change the background-colours and border-styles.

    about “ul” – i like it but i dunno how to position it this way

    floats, or display: inline-block, combined with sensible margins and enough width to ensure that you get two items per line.

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

Sidebar

Related Questions

What is the best way to make an HTTP GET request in Ruby with
What would be the best way to make these buttons? I have no problem
What's the best way (if any) to make an image appear grayed out with
What's the best way to implement an interface that looks like this in rails?
What is the best way to make a Delphi application (Delphi 2007 for Win32)
What is the best way to make a <div> fade away after a given
What is the best way to make trailing slashes not matter in the latest
What is the best way to make one of the branches of a subversion
what's the best way to make communications between page widgets residing on differents ViewPart?
What is the best way to make sure that all the environment variables I

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.