I have this but it doesn't work
var box = document.getElementById("box");
window.addEventListener('mousemove', function(e){
var left = e.pageX;
box.style.left = left;
});
If I just replace box.style.left = left; with jQuery it works fine
$('#wrap').css ({
left: left
});
but I'm just so confused... Why is box.style.left = left; not working when it's practically the same thing?