I have this code, when I hover over the div it moves, but I wanted it to happen when I hit the button:
<head>
<style>
.square{width:100px ;height:100px ;background:red ;transition: all 2s;}
.square:hover{background:blue;-webkit-transform:translateX(40px);}
</style>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<button id="moveRight"> Move Right</button>
<div class="square"></div>
</body>
</html>