国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

jQuery DOM operation wrapInner()

If you want to wrap all the child elements inside the elements in the collection with other elements and treat them as child elements of the specified element, for such processing, JQuery provides a wrapInner method

.wrapInner( wrappingElement ): Add a wrapped HTML structure to the interior of the matching elements in the collection

You may not understand it after reading the text introduction. Let’s demonstrate a piece of code:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>wrapInner()</title>
    <script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script>
</head>
<body>
    <p>php中文網(wǎng)</p>
    <p>php.cn</p>

    <script>
        $("p").wrapInner("<div></div>");
    </script>
</body>
</html>

Everyone You can press F12 to view the effect as follows:

7.png

As you can see, the internal elements of the two p tags are wrapped by div tags

Continuing Learning
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>wrapInner()</title> <script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script> </head> <body> <p>php中文網(wǎng)</p> <p>php.cn</p> <script> $("p").wrapInner("<div></div>"); </script> </body> </html>
submitReset Code