JavaScript Problem
Go to solution
Solved by Mooshe,
document.getElementsByTagName() does not return an HTMLElement, but rather an array of elements. You would need to iterate through the list to modify the style of each element:
for(h in document.getElementsByTagName("header")) {
h.style.top = ...;
}
if you just want to edit one specific element, I would recommend providing an ID attribute to that element to select it.

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now