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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:18:55+00:00 2026-05-12T11:18:55+00:00

I need to blink between two colors:red and white. I’ve found that after $targetcss(‘background-color’,’red’)

  • 0

I need to blink between two colors:red and white.

I’ve found that after $targetcss('background-color','red'),

value of $targetcss('background-color') is not red,but rgb(255, 255, 255),

pay attention that there is a space between “,” and digit in firefox,

but there is no space in IE.

And my code is now :

if(existingBgColor != 'rgb(255, 255, 255)')
    $target.css('background-color', 'rgb(255, 255, 255)');
else 
    $target.css('background-color', 'white');

Which works in firefox,but no for IE.

Of course I can change it to this to make it apply for IE:

if(existingBgColor != 'rgb(255, 255, 255)' && existingBgColor != 'rgb(255,255,255)')
    $target.css('background-color', 'rgb(255, 255, 255)');
else 
    $target.css('background-color', 'white');

But what for a third browser?

Is there a standard solution for 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-12T11:18:55+00:00Added an answer on May 12, 2026 at 11:18 am

    You could simply trim out all the whitespace before testing:

    existingColor = existingColor.replace(new RegExp(/[" "]/g), ""); //rgb(255,255,255)
    

    edit: as argued in the comments: Hex values are cross browser, and very easy to use. But if you insist on rgb values, then the above code will help you sort out your issues. However. If you start writing stuff like $myElm.css("background-color", "red");, you’re gonna get a whole new set of issues…

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

Sidebar

Related Questions

I've created a semi-transparent form (60% opacity with black background color) that my app
I have a field that may be blank, so I need to use Object.try,
Need a function that takes a character as a parameter and returns true if
Need to an expression that returns only things with an I followed by either
Need a function like: function isGoogleURL(url) { ... } that returns true iff URL
Hi In Gvim I need to insert a blank line or two before every
I'm using CUP to create a parser that I need for my thesis. I
I need two consecutive div elements (with backgrounds) to be touching seamlessly, one below
I've always been curious about this. Between the two code example which is more
I am trying to concatenate two date columns, putting a - between the values.

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.