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

121
Views
how to add css id in javascript

I want to add the filters css I have every time I click on the photos, I want to apply the original photo to the original photo with this ID at any time.

            <img src="./assets/img/template.jpg" alt="none" />
          
          none
        
        
          
            <img
              id="grayscale"
              src="./assets/img/template.jpg"
              alt="grayscale"
            />
          
          grayscale
        

---- css #grayscale { filter: grayscale(1); }

#sepia { filter: sepia(1); }

#invert { filter: invert(1); }

#blur { filter: blur(2px); }

#saturate { filter: saturate(2); }

#contrast { filter: contrast(2); }

const handleFilter = (e) => { const { target } = e; const { id: filter } = target; // filter: "grayscale" | "sepia" | "invert" | "hue-rotate" | "contrast" | "saturate" | "blur"

};

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You need to add a id in your div

document.getElementById('#yourId').style.property = new style
about 4 years ago · Juan Pablo Isaza 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!