I am calculating the x variable earlier in the code and i want to insert that variable value in the inline style of the div, but it doesn't work, though it works perfectly if i insert constant like "100px".
var x;
document.getElementById("block").style.position = "fixed";
document.getElementById("block").style.left = x;
Note: i want to get it working without using jquery because i am using only a couple of scripts on the website and it is useless to link a big library in my case.