This snippet shows how to get element next to your element / selector. This a part of dom traversal. Using javascript for next element parsing can be used to create some powerful dynamic content. I myself used it for getting next row of table that was added there by PHP, that will be slided open when clicking on the main shown row.
Source code viewer
document.getElementById('element-id').nextSibling; document.getElementById('element-id').previousSibling;Programming Language: Javascript