I have an element grabbed from document.getElementById(\'the_id\'). How can I get its next sibling and hide it? I tried this but it didn\'t work:
document.getElementById(\'the_id\')
Take a look at the Element Traversal API, that API moves between Element nodes only. This Allows the following:
elem.nextElementSibling.style.display = 'none';
And thus avoids the problem inherent in nextSibling of potentially getting non-Element nodes (e.g. TextNode holding whitespace)