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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:31:45+00:00 2026-06-05T20:31:45+00:00

Got a question for some jQuery wizard who might stumble upon this. When I

  • 0

Got a question for some jQuery wizard who might stumble upon this.

When I use border-left-color, for example, to set a color for an input element using jquery, and when this input element has input:focus{ border-color: somecolor; } in the css file, jquery destroys the input:focus setting. When input gets focus, it stays the color I set it to using jQuery.

Is this a bug?

And if not, how can I prevent this from happening? 🙂

  • 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-06-05T20:31:46+00:00Added an answer on June 5, 2026 at 8:31 pm

    jQuery .css is stronger than the definition in your CSS file because it adds inline styles.

    You should add !important to the :focus css definition.

    Live DEMO

    When using .css() as a setter, jQuery modifies the element’s style property.
    For example, $(‘#mydiv’).css(‘color’, ‘green’) is equivalent to document.getElementById(‘mydiv’).style.color = ‘green’.

    .css docs

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

Sidebar

Related Questions

I've got this page I'm doing some tests in Javascript and jQuery: JS Tests
We are using TFS 2010 with gated checkins. I've got some question about what
Time for another silly question :) I got some tables in a xhtml-document with
got a weird question for you based on some weird happenings on our site.
I saw some code on an unrelated question but it got me curious as
Pretty simple question. I've got some Polygons and GroundOverlays defined in KML. Is there
I've got a site with some administrative pages in its root directory. Question: Is
I'm using jQuery. This is my second post to make my old question more
I've already asked question similar to this some time ago, I thought I solved
I've got a question about using WYMEditor in ASP.NET MVC 3 with jQuery. I'd

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.