Home > Web Front-end > JS Tutorial > body text

How to get nodes such as brothers and parent classes in js_javascript skills

WBOY
Release: 2016-05-16 17:05:10
Original
1145 people have browsed it

var chils= s.childNodes; //Get all the child nodes of s

var par=s.parentNode; //Get the parent node of s

var ns=s.nextSbiling; // Get the next sibling node of s

var ps=s.previousSbiling; //Get the previous sibling node of s

var fc=s.firstChild; //Get the first one of s Child node

var lc=s.lastChile; //Get the last child node of s

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