Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
  <style>
    body {
      background: #333;
    }
    div {
      width: 100px;
      height: 100px;
      background: magenta;
      transition: 0.5s;
    }
     
    .foo {
      background: aqua;
      transform: translate(100px, 100px) rotate(0.5turn);
    }
  </style>
</head>
<body>
  <div></div>
  <script>
    document.querySelector('div').addEventListener('click', function(){
      this.classList.toggle('foo');
    });
  </script>
</body>
</html>
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers