On my site, I create a div
dynamically after the second paragraph (forum).
I would like to place a banner already loaded within this div
.
I tried several ways, give apendchild
, but it will not.
Here is the URL of the site to understand:
Below the code I'm using to create div
:
var meupost = document.getElementsByClassName("post entry-content ")[0];
var meudiv = meupost.getElementsByTagName("p")[1];
var meubanner = document.createElement("div");
meubanner.id = "banner300x250-1-auto";
meubanner.setAttribute('class','ipsBox_container');
meubanner.style.height = "250px";
meubanner.style.width = "300px";
//meubanner.style.position = "relative";
meubanner.style.float= "right";
meupost.insertBefore(meubanner, meudiv);