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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:08:51+00:00 2026-05-18T03:08:51+00:00

I have an input, when someone hovers over the input I want it’s BGcolor

  • 0

I have an input, when someone hovers over the input I want it’s BGcolor to change to gray, then when they hover off of the input I want it’s BGcolor to change back to white(default color). But I also want the input’s BGcolor to change to gray when there’s focus on the input, but when the person has focus on the input, and then moves the cursor off of the input, the BGcolor will change back to white even if the input has focus. So basically I want the mouseover mouseout functionality to be disabled when the input box has focus, and then when it doesn’t have focus anymore, re-enable the mouseover mouseout functionality.

Can anyone help me out? I’m not sure how 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-18T03:08:52+00:00Added an answer on May 18, 2026 at 3:08 am

    More generally, to detect whether an element has focus you might want to flag it somehow in its onfocus handler and clear the flag in its onblur handler. The ‘flag’ could take a number of forms, but a nice way of doing this in jQuery is to add/remove a class, which you can then check for elsewhere. For example:

    $('input.trackingFocus').focus(function(){
        $(this).addClass('hasFocus');
    });
    $('input.trackingFocus').blur(function(){
        $(this).removeClass('hasFocus');
    })
    
    $('input.trackingFocus').hover(
        function(){
            // do stuff on mouse in
        },
        function(){
            if ($(this).hasClass('hasFocus')) {
                // do stuff on mouse out for elements with focus
            } else {
                // do stuff on mouse out for elements without focus
            }
        }
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an input box that I don't want postback to occur on someone
I have input.txt and I want to search for a string and extract a
i have input xml as <content> <date> <day>14</day> <month>06</month> <year>2012</year> </date> </content> want it
I have an input <input> When someone pastes multi-line text into the input, I
I have an input file that I want to sort based on timestamp which
I have an input field and I want that variable to be passed as
I have an INPUT text box. As someone types into the INPUT text box,
I have an input box whose id is sellingprice . i want to check
So I have an input form that I want to use to update a
i have an input that generates a positioned unordered list when someone enters a

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.