On 16/11/06, Wes Gamble <[EMAIL PROTECTED]> wrote: > > All, > > Does Element.setAttribute() work in IE? Do I need to address the > attributes > differently perhaps? > > ==================== > > newDiv = popup.document.createElement('div'); > newDiv.setAttribute ('id', 'pdf'); > newDiv.setAttribute('style', 'margin-top: 250px; text-align: > center;'); > newDiv.innerHTML = 'Please wait while your forms are > generated<BR/><BR/><IMG > src="' + wait_image_url + '"/>'; > popup.document.body.appendChild(newDiv);
Hello Wes, Yes, setAttribute works in IE, but the way to set styling for an element via JS is not via setAttribute but like this: newDiv = popup.document.createElement('div'); newDiv.setAttribute('id', 'pdf'); newDiv.style.marginTop = '250px'; newDiv.style.textAlign = 'center'; newDiv.innerHTML = 'Please wait while your forms are generated<BR/><BR/><IMG src="' + wait_image_url + '"/>'; popup.document.body.appendChild(newDiv); Also, if you're using XHTML (seems like it since you're writing <BR/> instead of <BR>) you need to do everything in lowercase, i.e. <br /> and <img />. Rafael ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/