亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

jQuery property node

In the previous section, we have already talked about how to create nodes and what are text nodes

In this section we will learn how to create attribute nodes

How to create attribute nodes and how we create text nodes It’s the same. Let’s look at a piece of code.

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script>
    <script>
        $(function(){
            var $div = $("<div name='dv'></div>");
            $("body").append($div);
        })
    </script>
</head>
<body>
    
</body>
</html>

Look at the above code. First, we create an attribute node, and then add the node to the body. In the browser, we press F12 to debug, and you can see the following In the source code, <div name='dv'></div>
has been added to the body

Continuing Learning
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script> <script> $(function(){ var $div = $("<div name='dv'></div>"); $("body").append($div); }) </script> </head> <body> </body> </html>
submitReset Code