jQuery DOM ?? WrapAll()
wrap? ?? DOM ?? ??? ?? ????. ?, ???? ??? ?? ??? ????? ??, ? ??? ??? ?? JQuery? WrapAll ???
wrappingElement)? ?????. ???? ???? ??? ?? ?? ?? HTML ??
??? ??? ?????
?? ??? ?????.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>wrapALL</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").wrapAll("<div></div>"); </script> </body> </html>
? ??? ??? ?? ???? ????? F12 ?? ?? ? ? ????. ? ??? ???. p ??? div ??? ???? ????