JavaScript: Get all previous/next siblings

1
2
function getSiblings(element, type){
var arraySib = [];
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Latest version: - Add example; - Fixed 'previousSiblings' into 'previousSibling'; - Fixed 'nextSiblings' into 'nextSibling';

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.