在jquery中创建html标签 [英] Create html tags in jquery
本文介绍了在jquery中创建html标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<header id="headerClass">
<div class="loader">
<div class="title">Loading...</div>
<div class="load">
<div class="bar"></div>
</div>
</div>
</header>
可以任意一个帮助如何将它们转换为jquery我的意思是jquery dom
can any one help how to conver them to jquery i mean jquery dom
推荐答案
有各种方法可以做到这一点,正如@F_ES Sitecore建议的那样,我的建议也是看看针对不同的解决方案,选择最适合您需求的解决方案。
一个简单的方法可以是 -
There are various ways to do this so, as suggested by @F_ES Sitecore, my suggestion is also to look for different solutions and pick that which best suits to your requirement.
A simple way to do this can be like-
var elementBlockToBeAdded="<header id="headerClass"><div class="loader"><div class="title">Loading...</div><div class="load"><div class="bar"></div></div></div></header>";
( body ).append(elementBlockToBeAdded);
("body").append(elementBlockToBeAdded);
希望,它有帮助:)
Hope, it helps :)
这篇关于在jquery中创建html标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文