Home > Web Front-end > JS Tutorial > Introduction to using javascript nextSibling and getNextElement(node)_Basic knowledge

Introduction to using javascript nextSibling and getNextElement(node)_Basic knowledge

WBOY
Release: 2016-05-16 18:00:57
Original
1668 people have browsed it

1. nextSibing: The next node, the node type can be any type, including text nodes.

2. Get the next element node:

Copy the code The code is as follows:

function getNextElement(node){
if(node.nodeType == 1){
return node;
}
if(node.nextSibling){
return getNextElement(node.nextSibling );
}
return null;
}
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template