I want the javascript code to change the 'left' property of the bat1 div upon key press? HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>
<div id="bat1">
</div>
<script src="script.js"></script>
</body>
</html>
CSS:
#bat1{
width: 150px;
height: 20px;
background-color: blue;
position: relative;
left: 10%;
}