向 Jquery 选择和格式添加一些内容
好的,所以我正在尝试从页面上另一个位置的一些代码创建一个地址。我试图创建地址的代码是这样的:
<div class="adr">
<h3 class="name fn">Boardwalk Audi<div class="separator">|</div></h3>
<h4 class="street street-address">5930 West Plano Pkwy</h4>
<h4 class="city">
<span class="locality">Plano</span>, </h4>
<h4 class="state region">Texas</h4>
<h4 class="zipCode postal-code">75093</h4>
</div>
基本上我想用 JQuery 选择这些元素并将它们格式化为将以文本形式输出到页面上其他位置的格式样式如下:
Boardwalk Audi 5930 West Plano Pkwy, Plano, Texas, 75093
有人知道我该怎么做吗?
谢谢!
Ok, so i'm trying to create an address out of some bits of code from another spot on the page. The code i'm trying to create the address from is this:
<div class="adr">
<h3 class="name fn">Boardwalk Audi<div class="separator">|</div></h3>
<h4 class="street street-address">5930 West Plano Pkwy</h4>
<h4 class="city">
<span class="locality">Plano</span>, </h4>
<h4 class="state region">Texas</h4>
<h4 class="zipCode postal-code">75093</h4>
</div>
Basically i want to select these elements with JQuery and format them into something that will output as text onto the page somewhere else in the format style below:
Boardwalk Audi
5930 West Plano Pkwy, Plano, Texas, 75093
Anyone know how i can do this?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
像这样的东西吗? http://jsfiddle.net/YJrzn/
Something like this? http://jsfiddle.net/YJrzn/