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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:49:46+00:00 2026-05-29T18:49:46+00:00

I have the following: container.removeClass(ui-state-error-icon).removeClass(ui-icon-alert); container.addClass(ui-state-error-icon).addClass(ui-icon-alert); Is there a simple way that I can

  • 0

I have the following:

container.removeClass("ui-state-error-icon").removeClass("ui-icon-alert");
container.addClass("ui-state-error-icon").addClass("ui-icon-alert");

Is there a simple way that I can also add and remove the following CSS?

display: inline-block;

I looked at the jQuery documentation and found this:

$(this).css("color","red");

But how would I remove the display parameter?

Thanks

  • 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-29T18:49:47+00:00Added an answer on May 29, 2026 at 6:49 pm

    You know you can pass several classnames in removeClass and addClass like this, separated by whitespace:

     container.removeClass("ui-state-error-icon ui-icon-alert");
     container.addClass("ui-state-error-icon ui-icon-alert"");
    

    To change the “display” css rule, use .css() as you saw in the doc.

    Now you cannot exactly add or remove the css rule, you have to replace the value of “display” by something else, and it depends on what you want to achieve:

    You can set the value to empty string to remove the inline css rule. As @nnnnnn stated, the value of “display” will then be – either the one defined in a remaining css class applied to the element – or the default value of “display” for the type of element.

    container.css('display', ''); 
    

    Values of the rule “display” – display (css property)

    Inline elements

    Block-level elements

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

Sidebar

Related Questions

In Java, assume I have the following class Container that contains a list of
I have following html. How can I get this so that dragDiv is shown
I have following classes: Container , Element and then couple of classes that inherit
I have a container div with the following CSS: #container { position:relative; overflow:hidden; width:200px;
I have the following model structure: class Container(models.Model): pass class Generic(models.Model): name = models.CharacterField(unique=True)
I have the following function which creates a std::vector of iterators into another container:
How would I setup my controls for the following situation?: I have a parent-container
I have the following: container.dialog().bind('dialogopen', function(event, ui) { ... if (someCondition) { $(this).dialog('close'); //
I have a following css #container { border:1px solid black; } #container #header {
I have the following css code .container { width:800px; background-color:yellow; margin:auto; display:table; } .cell

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.