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

153
Views
It's possible to execute css on javascript function

I need to change CSS when i click on picture. I do somes search and i find the function onclick="js function" but i don't know how to execute the css. Here is the css i need to execute on the function onclick=""

.all:hover {
perspective: 1000px;
transition: all 1.3s ease-in;
transform: perspective(10000px) rotateX(0deg);
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

this is a way for what you want:

1- Give an ID to your picture

2- you should create a class in your css file and give it these "hover" styles.

3- you should create a js function and call it with "onclick" picture event. in this example, I called my function, "myFunction".

4- create a script tag and write this function for what you want:

function myFunction() {
  var element = document.getElementById("your picture ID");
  element.classList.add("Put the class you just created in your css file");
} 
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!