I am trying to insert a block of html code using prototype.js
I have been able to do this when I target an html element such as
$('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? and insert a block html after it?
Thanks in advance
Sure. Just use after
as the first parameter for insert()
:
$('level3').insert({after: '<p>HTML goes here</p>'});