<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
h2 {
color: blue;
-webkit-animation: myMultiColor 1s infinite;
animation: myMultiColor 1s infinite;
}
/* Safari 4.0 - 8.0 */
@-webkit-keyframes myMultiColor {
from {color: blue;}
to {color: green;}
}
/* Standard syntax */
@keyframes myMultiColor {
from {color: blue;}
to {color: green;}
}
</style>
</head>
<body>
<h2>Animation is Awesome</h2>
<p id="point"></p>
<script>
var count = 0;
var x = document.getElementsByTagName("h2")[0];
function myFunction() {
count +=1;
var txt ="Iteration Count: "+count;
document.getElementById("point").innerHTML = txt;
}
window.onanimationiteration = myFunction;
</script> </body>
</html>