You can access styling properties of an object through the .style
attribute of the object. I.e:
mybutton.style.top = "10px";
Getting the windows current hight is trickier in pure JS, but the jQuery library does it with ease:
$( 'window' ).height();
If you don't want to use jQuery then here is how to do it with just JS: JavaScript - Get Browser Height
If your intent is achievable with just CSS and percent values that is the best way to go, but I assume you are trying to attach something that is going to float relative to window size, like a footer that is always in the bottom, which without some of the new CSS3 selectors can be a pain in CSS and probably should be solved in JS.