My script wont run or the document.getElementById("toMove"); doesn't seem to catch the element. Its very basic javascript but I cant understand why its not working.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
<style>
#toMove
{
background-color:lightblue;
position:absolute;
}
</style>
<script>
var elem = document.getElementById("toMove");
elem.style.margin = "600px";
</script>
</head>
<body>
<div id="toMove" style="margin:200px; font-size:26px;"> Hello World</div>
</body>
Thanks