var div = document.getElementById("vrijwilligerswerk"); if (!div) div = document.getElementById("Vrijwilligerswerk"); const iframe = document.createElement("iframe"); iframe.src = "https://www.vrijwilligerswerk.be/widget/8a61390f-8650-4153-94c5-cebf07f63510/search"; iframe.style.height = "100%"; iframe.style.width = "100%"; iframe.style.overflow = "hidden"; // div.style.overflow = "hidden"; iframe.style.border = "none"; iframe.style.height = '800px'; div.appendChild(iframe); iframe.contentDocument.onreadystatechange = function () { if (iframe.contentDocument.readyState === "complete") { iframe.style.height = iframe.contentDocument.body.scrollHeight + 'px'; } }