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);
}
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");
}