Return to Snippet

Revision: 2420
at February 13, 2007 04:48 by 1man


Initial Code
function getNextElement(node) {
	if(node.nodeType == 1){
		return node;
		}
	if(node.nextSibling) {
		return getNextElement(node.nextSibling)
		}
	return null;
}

Initial URL

                                

Initial Description
Useful function for CSS DOM, returns the next element after the selected node. So you could style the element directly after a h1 element for example.

Initial Title
getNextElement DOM function

Initial Tags
css, DOM

Initial Language
JavaScript