Using JS to move a div issues

Giganews Newsgroups
Subject: Using JS to move a div issues
Posted by:  k (kalez…@gmail.com)
Date: Thu, 1 Aug 2013

This is my code I want to move the div to the left and the div won't move.

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body{background-color:#25E01B}
#box{width:150px; height:100px; background-color:#1B9EE0; position:absolute}
#buttonmove{background-color:red}
</style>

<script>
function Move(){
var b = document.grtElementById("box");
b.style.right="400";
}
</script>

</head>
<body>

<div style="left:10px" id="box" onmousedown="handleDown(event)"></div>

<br /><br /><br /><br /><br /><br /><br /><br />

<form><input id="buttonmove" type="button" value="click to move box" onclick="Move()"></form>
</body>
</html>

Replies