Here's a snippet that changes the height of a div when 'HERE' is clicked.
I want the click to change the percent of the animation-progress instead (for example, to 50%). How can that be achieved?
function f() {
document.getElementById('id1').style.height = "10px";
}
@keyframes k {
0% {
background-color: red;
}
100% {
background-color: blue;
}
}
.a {
height: 100px;
width: 100px;
animation: k 10s infinite;
}
<div id="id1" class="a"></div>
<div onclick="f()">HERE</div>