This is mostly a CSS question. The CSS style bottom: 0 will not work when position is "static" (the default in-layout position). You would have to specify something like this CSS (with position of absolute or fixed):
#footer {
position: absolute;
bottom: 0;
}
or this code:
var productElement2 = document.getElementById("footer");
productElement2.style.position = "absolute";
productElement2.style.bottom = "0";
Also, note the single equals sign to set a variable. You had a double equals sign which is a test of equality, not an assignment.
In addition, your getElementsByTagName returns an array, not a single item. If you wanted to get a single item with a CSS id, you would use getElementById as I've shown here. If you wanted to get the first item from the array returned by getElementsByTagName, then you'd have to reference the first item in the array rather than the entire array.