var title="Perfekte Schlafdauer: Wie viel Schlaf brauchst du in deinem Alter wirklich?"; var short="Das Schlafverhalten eines Menschen ändert sich im Laufe des Lebens, das ist schon länger bekannt. Aber hängt die ideale Schlafdauer wirklich vom Alter ab? Wie viele Stunden pro Nacht sind für wen perfekt?"; var thumb = "https://www.infranken.de/storage/image/9/0/8/1/3751809_artikel-aufmacher-md_1ArrXe_JvqXx8.jpg"; var widget= document.getElementById("if_widget1714073559"); var h3 = document.createElement("h3"); var shortspan = document.createElement("span"); var img = document.createElement("img"); var a = document.createElement("a"); var divclearer = document.createElement("div"); var titletext = document.createTextNode(title); var shorttext = document.createTextNode(short); var linktext = document.createTextNode("mehr auf inFranken.de"); var imgsrc = document.createAttribute("src"); var imgstyle = document.createAttribute("style"); var divclearerstyle = document.createAttribute("style"); var ahref = document.createAttribute("href"); var atarget= document.createAttribute("target"); imgsrc.nodeValue = thumb; imgstyle.nodeValue = "float:left;margin-right:10px;width:100px;"; ahref.nodeValue = "https://www.infranken.de/5408870"; divclearerstyle.nodeValue ="clear:both" ; atarget.nodeValue = "_blank"; h3.appendChild(titletext); shortspan.appendChild(shorttext); a.appendChild(linktext); a.setAttributeNode(ahref); a.setAttributeNode(atarget); divclearer.setAttributeNode(divclearerstyle); img.setAttributeNode(imgsrc); img.setAttributeNode(imgstyle); var astyle = document.createAttribute("style"); astyle.nodeValue = "display:block;margin-top:20px;"; a.setAttributeNode(astyle); widget.innerHTML=""; widget.appendChild(h3); widget.appendChild(img); widget.appendChild(shortspan); widget.appendChild(a); widget.appendChild(divclearer);