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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:07:27+00:00 2026-05-18T08:07:27+00:00

I have a save button, and when the user mouses over it, I change

  • 0

I have a save button, and when the user mouses over it, I change some styles – for example:

$('.saveButton').mouseover(function() {
   $(this).css("background-color", "red");
   $(this).parents('fieldset').css("border", "2px solid red");
});

When the mouse leaves the button, I would like to restore the original:

$('.saveButton').mouseout(function() {
   $(this).css("background-color", "#EEE");
   $(this).parents('fieldset').css("border", "1px solid gray");
});

However, leaving aside the matter of whether or not the default button background color is #EEE, when this code executes the button loses its rounded look, and has square corners.

Is it possible to do this?

  • 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-18T08:07:28+00:00Added an answer on May 18, 2026 at 8:07 am

    I would suggest not to set the properties directly, but set a class/classes instead:

    $('.saveButton').mouseover(function() {
       $(this).addClass('highlight');
       $(this).parents('fieldset').addClass('highlight');
    }).mouseout(function() {
       $(this).removeClass('highlight');
       $(this).parents('fieldset').removeClass('highlight');
    });
    

    With

    .saveButton.highlight { /* Double class selector is broken in IE6 */
       background-color: red;
    }
    
    fieldset.highlight {
      border: 1px solid red;
    }
    

    If for some reason you don’t want to do that, instead of setting the properities to a specfic value, but to an empty string. That should “remove” that property:

    $('.saveButton').mouseout(function() {
       $(this).css("background-color", "");
       $(this).parents('fieldset').css("border", "");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code like this: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Save([Bind(Prefix=)]Person person) { String s
I want to have a user control containing a save button. I want the
I have three buttons and need to save some data. I have a idea,
I have some slow internet task to save and load file, I'd like to
We have the requirement to take a form submission and save some data, then
I am using an user control which have a button named 'btn_Save'.I need to
I have an application without a save button; saving happens automatically in the background.
I have a modal view which gets the user to select some data to
Is it possible to have Python save the .pyc files to a separate folder
With reference to Problem with date day/month reversing on save I have further noted

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.