Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

123
Views
how do you add inline styles in jquery?

Hi so this what I have in jquery however it doesn't seem to work, am I missing something?

 modalClose.on("click", () => {
        modalContainer.removeClass("modal-open");
        modalContainer.attr("style", "display:none");
    });
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You use the css function, passing it an object with the properties, you use camel case rather than hyphens.

modalClose.on("click", () => {
        modalContainer.removeClass("modal-open");
        modalContainer.css({display: 'none'});
});

//Use camel case for properties with hyphens. style="display: none; background-color: #FFFFFF"
jQuery('.youritem').css({display: 'none', backgroundColor: '#FFFFFF'})

To remove a property from your html send an empty string to the property, the following removes both the display and background-color properties.

jQuery('.youritem').css({display: '', backgroundColor: ''})

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!