Through the JS Operation DOM node may be in the node units, such as the addition of nodes, you can createelement,createtextnode, and then use AppendChild to bind the text node and the container node together, It is then added to the DOM tree with AppendChild or insertbefor. But if you want to add a large number of nodes to the DOM tree dynamically. It will be very troublesome. And each time the DOM is refreshed, causing a performance flaw.
The workaround is to use the document fragment method to create the document fragment.
I personally think it would be appropriate to translate this into a document fragment.
Use the jquery solution.
<span style= "FONT-FAMILY:FANGSONG_GB2312;FONT-SIZE:18PX;" >
You can also use the following method to resolve<span style= "FONT-FAMILY:FANGSONG_GB2312;FONT-SIZE:18PX;" >
The effect is the same. Of course, you can also build a new node, such as a Div, to add op to the Div first, and then add the div to the body. But this will add a <div></div> to the body. However, document fragmentation does not produce such nodes.
Note: The binding fragment is actually attaching the contents of the fragment underneath the bound node. It does not produce nodes like <fragment></fragement>;
Best Wishes.