4
I have this code, when I pass the mouse 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>
erases the first answer
– zasalamel correy
@zasalamelcorrey You mean the first example is this ? It was not what you intended ?
– Isac
the second already served, erases the first
– zasalamel correy
got repetitive
– zasalamel correy
@Okay zasalamelcorrey I’ve removed, see if it’s easier for you to understand.
– Isac