The preferred method these days is by id:
Code:
document.getElementById('some_id').style.left='10px';
Or, if used in a function where the id is supplied as x:
Code:
function movemenu(x){
document.getElementById(x).style.left='10px';
}
Also, units (such as px) must be specified in most browsers for top, left, height, and width (as well as for a number of other style properties). If you are passing the value as a number held in a variable, the units must still be applied:
Code:
function movemenu(x, n){
document.getElementById(x).style.left=n+'px';
}
The getElementById method is case sensitive.
Bookmarks