Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<div id="box">
      click Me  
    </div>
</body>
</html>
 
#box{
  background-color: blueviolet;
  color: chartreuse;
  padding: auto;
  position: absolute;
  left: 10%;
  top: 10%;
  border-radius: 2px;
 cursor: pointer;
 user-select: none;
transition: all 150ms; 
}
 
(function (){
'use strict';
    function move (){
        const x = Math.random() * 90;
        const y = Math.random() * 90;
        box.style.left = x + '%';
        box.style.top = y + '%' ;
    }
box.addEventListener('mousemove',move);
})();
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers