Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] DOM: adding CSS to created DIV


  • From: list at tridemail.de (Michael Borchers)
  • Subject: [Javascript] DOM: adding CSS to created DIV
  • Date: Mon Jan 22 02:20:00 2007

The first version works fine for FF, but not for IE.
The second one works fine for both.

 var entryLayer = document.createElement('DIV');

 entryLayer.setAttribute('id','calendarEntryFormLayer');
    // FF, not IE:
    entryLayer.setAttribute('style','position:absolute;left:200px;top:300px;width:100px;height:100px;background-color:#ffffff;color:#ffffff;;border:1px 
solid #0b234c;padding-left:10px;z-index:3000;display:block;');

    // both:
    entryLayer.style.cssText = 
'position:absolute;left:200px;top:300px;width:100px;height:100px;background-color:#ffffff;color:#ffffff;;border:1px 
solid #0b234c;padding-left:10px;z-index:3000;display:block;';

 document.body.appendChild(entryLayer);


any reason?