JQuery 重新格式化文本并更改顺序
我目前有这样的数据设置。
<div>zone 1,2 and 3 Tube ticket single to £2.20</div>
<div>zone 1,2 and 4 Bus ticket single to £3.20</div>
等等..还有很多。
我将如何使用 Jquery 像这样重新格式化它..
<div>123, Tube ticket single, 2.20</div>
<div>124, Bus ticket single, 3.20</div>
非常感谢,
I have data set up like this at the moment.
<div>zone 1,2 and 3 Tube ticket single to £2.20</div>
<div>zone 1,2 and 4 Bus ticket single to £3.20</div>
etc.. and there is a lot.
How would I use Jquery to reformat it like this..
<div>123, Tube ticket single, 2.20</div>
<div>124, Bus ticket single, 3.20</div>
Many Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果没有 jQuery,您可以执行以下操作:
Wich 显示:“123,Tube Ticket single,2.20”
使用 jQuery:
Without jQuery you can do :
Wich displays: "123, Tube ticket single, 2.20"
With jQuery:
您可以这样做:-
为了快速测试,请参阅实时演示
HTML
JS
输出
You can do this way:-
For your quick testing, refer the LIVE DEMO
HTML
JS
OUTPUT