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 7685615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:17:26+00:00 2026-05-31T19:17:26+00:00

I have a set of buttons. I want that when I do mouse up

  • 0

I have a set of buttons. I want that when I do mouse up on one of the buttons, that particular button will change its back colour while all the other will remain the same.

Any help on how to do it without having any post back.?

  • 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-31T19:17:27+00:00Added an answer on May 31, 2026 at 7:17 pm

    Here’s a fairly clunky way to do it:

    <style>
    .selected { background-color : red; }
    </style>
    <script>
    var theForm = document.getElementById("someForm");
    theForm.onmouseup = function(e) {
        // allow for IE
        if (!e) e = window.event;
    
        var src = e.srcElement || e.target;
    
        if (src.tagName.toLowerCase() === "input"
            && src.type.toLowerCase() === "button"){
            src.className = "selected";
            for (var i = 0; i < theForm.children.length; i++)
                if (src != theForm.children[i])
                    theForm.children[i].className = "";
        }             
    };
    </script>
    

    Demo: http://jsfiddle.net/Yn3pT/

    This assumes the buttons are children of a form called “someForm” and that a class “selected” exists that has the appropriate colour – obviously you’ll modify this as appropriate to suit your markup.

    Note that the above should either be in an onload handler or the script block should be somewhere after the elements in the source.

    Note also that onclick would be much more appropriate than onmouseup for this.

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

Sidebar

Related Questions

So we have a <p class=ex id=grumble3>button</p> we want to set such $('#grumble3').mouseup(function(){ that
I have a set of buttons that I want to add into an array
I have a set of Yes / No radio buttons that I want to
Here's the scenario: I have a set of buttons that I want to bind
I have set the two buttons in preference.xml file. I want to go to
I have a set of radio buttons. In some cases I want the user
I have a set of buttons on one of my custom entities ribbon and
I have a set of radio buttons that are dynamically generated (via JSON call):
I have a series of buttons that display filenames. If I set the Text
I have a set of radio buttons where when I click a radio button,

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.