how do I make and animation start on click in js

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
.classname {
  -webkit-animation-name: cssAnimation;
  -webkit-animation-duration:3s;
  -webkit-animation-iteration-count: 1;
  -webkit-animation-timing-function: ease;
  -webkit-animation-fill-mode: forwards;
}
@-webkit-keyframes cssAnimation {
  from {
    -webkit-transform: rotate(0deg) scale(1) skew(0deg) translate(100px);
  }
  to {
    -webkit-transform: rotate(0deg) scale(2) skew(0deg) translate(100px);
  }
}
</style>
<script type="text/javascript">
  function ani(){
    document.getElementById('img').className ='classname';
  }
</script>
<title>Untitled Document</title>
</head>

<body>
<input name="" type="button" onclick="ani()" />
<img id="img" src="clogo.png" width="328" height="328" />
</body>
</html>

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
animated on click js javascript animation on click click animation javascript how to play animation on click javascript hwo to activate a animation on click in javascript start animation on button click js javascript animation on click javascript add animation to element on click animation in js on click js click animation how to work an animation on click in javascript start animation on click javascript how to make an animation happen onclick javascript launch animation from a click javascript html onclick trigger animation how to start css animation on click with javascript how to make an onclick animation javascript how to make an click animation javascripy css animation trigger on click how to trigger an animation on click in js How to use the click event JavaScript to trigger an animation on a div javascript start animation on click how to animate with css when i click css animation on click javascript javascript play css animation on click function onclick animation css animation run on click how to make on click animation css and javascript start anumation after click css run css animation on click onclick start an animaiton css javascript animation on click css keyframe on click button animation while click css css activate animation on click javascript start css animation onclick css animation after click onclick animation to div js animation on click animate link on click css animation js click onclick css animation press play css animation on click how to add animation in onclick event using javascript how to run css animation on click animation on click in css animate on click css on click animation htlm on click animation css transiion on click trigger keyframe animation on click onclick appear slowly css animation run animation on click js run animation on click css keyframes js onclick onclick apply transition css transition on click Aimate after click css animate on click css animate when clicked animation on click css transition onclick css add css animation to element on click add css animation on click if click make animation javascript animation css onclick onclick animation css css show animation on click how to do css animations with js how to use css transtion on button click on click start css animation on click animation name css animation start on click css div animation on click on click animate animating object on click in css on click add animations js trigger css animation on button click apply css animation on click javascript do css animation on click javascript css animation in click make an animation on click html5 css animation when click css trigger css animation on click on button click play css animation animation js on click on click css animation css trigger animation on click animation css on click css onclick animate onclick css animation with statue onclick run css animation on click start animation only css start animation when clicked css start animation when clicked animate div on click css onclick animation run keyframes on click play animation on button click js javascript css animation on click javascript trigger animation on click div click css anomation onclick css animation havascript transitions and animations javascript transitions animations how to trigger a keyframe onclick javascript trigger css animation on click begin animate after click css onclick animation javascript add animation to body onclick activate css on click how can i have a keyframes animation start onclick how can i trigger an animation onclick event in javascript animate on click css js onclick naimate animation onclick css CSS animation fast clicking css animation on click jquery run css animation on click click to play animation css on click play animaiton how do I make and animation start on click in js
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source