var txt1=<h1>Text.</h1>;
The second type: through jQueryvar txt2=$(<h2></h2>).text(Text.);
The third type: through JavaScript/DOMvar txt3=document.createElement(h3);
txt3.innerHTML=Text.;
The above summary of the three methods of creating new elements is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.
Original address: http://www.cnblogs.com/SoYang/p/5677589.html