Node Type nodeType

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>节点类型nodeType</title>
    <!-- 
        node.nodeType; node acquires the node type of the node, the value of the return type, specific values ​​are described in the inserted picture
     -> 
</ head > 
< body > 
    < div > < H3 > nodeType type table </ H3 > < strong > in front of the figure is the value returned by ele.nodeType </ strong > < br /> < br /> < IMG the src = "../ IMG / nodeType.png" Alt = "" > </ div > 
    < Script > 
        var div = document.getElementsByTagName ( " div " ) [ 0 ];// get the div element
        the console.log (div.nodeType); // print the div node type value 
    </ Script > 
</ body > 
</ HTML >

Guess you like

Origin www.cnblogs.com/vinson-blog/p/12112733.html
Recommended