[英]How do I insert content after a block of text using prototype.js?
I am trying to insert a block of html code using prototype.js 我正在尝试使用prototype.js插入html代码块
I have been able to do this when I target an html element such as 当我将html元素作为目标时,我已经能够做到这一点
$('footer').insert({top: '<div id="footer_inner"><small>CompanyName, LLC</small></div>'})
Is it possible to inset a div after text such as 是否可以在诸如
Is it possible to target the text level3? 是否可以定位文本级别3? and insert a block html after it?
并在其后插入一个html块?
Thanks in advance 提前致谢
Sure. 当然。 Just use
after
as the first parameter for insert()
: 只需将
after
作为insert()
的第一个参数即可:
$('level3').insert({after: '<p>HTML goes here</p>'});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.