Q&A: Dynamically assigning CSS Floating in JavaScript
April 2nd, 2007Q: I am creating some HTML elements using JavaScript and the DOM. All is fine, but I need to define one element as floated to the right. I tried var d=document.createElement(‘div’); d.setAttribute(‘float’,’left’); which seems to do it, but the element is not floated. I tried then to use the style collection with d.style.float = ‘left’; […]