How do I add a div dynamically That i can alter afterwards.
this adds it but I can't alter the style. Any ideas what I'm doing wrong?Code:function addElement(parent, id, style, inner) { var parentElement = document.getElementById(parent); var newdiv = document.createElement('div'); newdiv.setAttribute('id',id); newdiv.innerHTML = inner; parentElement.appendChild(newdiv); return true; }
![]()



Reply With Quote


Bookmarks