<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>Title</title> <style>Div{width:300px;Height:300px;Background-color:Pink; } </style></Head><Body><Div> <P>1111</P> <P>2222</P> <!--<a href= "http://web.itcast.cn" target= "_blank" >itcast</a> -</Div><span>I'm a span outside.</span><Scriptsrc= "Jquery-3.2.1.js"></Script><Script> $(function () { //dynamically creating Nodes var$a= $("<a href= ' http://www.baidu.com ' target= ' _blank ' >RayLee</a>"); $("Div"). append ($a); //emptying nodes, clearing the portal $("Div"). empty (); //Delete a node //$ ("div"). Remove (); //Add Event $("span"). Click (function() {alert ("span"); }) //Clone node True replication with event, false default replication, no event $("span"). Clone (true). AppendTo ("Div"); });</Script></Body></HTML>
<jquery>. Twelve. Node operations (adding nodes, deleting nodes, cloning nodes, emptying nodes)