2
2obvious
During the window.onload event, I set the .onclick event of an element
to turn off the display of the first two elements in a <div> called
"content":
var objNode = getElementById("content").getElementsByTagName("h1")[0];
objNode.style.display = "none";
objNode.nextSibling.style.display = "none";
Unfortunately, this (and several other slight variations on this) was
unable to recognize "nextSibling" as a function. What is it I'm not
understanding here?
(On a related note, I probably would have used the .firstChild()
function to grab that header, but I had no luck with that either, and
..nextSibling is the more serious problem.)
to turn off the display of the first two elements in a <div> called
"content":
var objNode = getElementById("content").getElementsByTagName("h1")[0];
objNode.style.display = "none";
objNode.nextSibling.style.display = "none";
Unfortunately, this (and several other slight variations on this) was
unable to recognize "nextSibling" as a function. What is it I'm not
understanding here?
(On a related note, I probably would have used the .firstChild()
function to grab that header, but I had no luck with that either, and
..nextSibling is the more serious problem.)