Javascript set left style doesn't work -


xpos=xpos+1; document.getelementbyid("img").style.left=xpos; 

i can't assign xpos value left property in javascript.

try adding unit it. otherwise it's not being read browser due being invalid css

document.getelementbyid("img").style.left= xpos + "px"; 

you can figure out these kind of things looking @ styles pane of browser's developer tools


Comments