⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e527. getting a node relative to another node in a dom document.txt

📁 这里面包含了一百多个JAVA源文件
💻 TXT
字号:
This example demonstrates the various methods for using a node to retrieve related nodes --- parent, child, etc. 
    // Get the parent
    Node parent = node.getParentNode();
    
    // Get children
    NodeList children = node.getChildNodes();
    
    // Get first child; null if no children
    Node child = node.getFirstChild();
    
    // Get last child; null if no children
    child = node.getLastChild();
    
    // Get next sibling; null if node is last child
    Node sibling = node.getNextSibling();
    
    // Get previous sibling; null if node is first child
    sibling = node.getPreviousSibling();
    
    // Get first sibling
    sibling = node.getParentNode().getFirstChild();
    
    // Get last sibling
    sibling = node.getParentNode().getLastChild();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -