We know that there are three ways to dynamically create elements in js. Elements can also be dynamically created in jQuery
For example:
var str = $("脚本之家"); $("ul").append(str); //将动态创建的str元素追加到ul下面
Append nodes
The methods to append nodes in js are appendChild (node element) and insertBefor (node element) , position), in jQuery it is
append appended after the last child node of the parent element
prepend inserted in front of the first child node of the parent element
after appended after the element, sibling
before element Append in front of, same level
The following code can be a good demonstration of appending nodes