Does anyone know how I can style dynamic elements created via the DOM method createElement
in IE7 with CSS.
As some of you may or may not already know, IE7 seems to refuse to style elements that are created using the DOM api but will quite happily style them using innerHTML
.
It seems to be a bug with IE7 only as IE8 has no problem with styling these dynamic elements.
On GitHub I forked this repo: https://github.com/ChiperSoft/Kalendae and wanted to convert it to support IE7 (it states it only supports IE8 but at first I noticed some basic things I could fix to get it working in IE7 and then I realised the main problem supported IE7 was again due to this bug where IE7 chokes on dynamic elements).
(for the sake of experiment...) I tried loading the CSS after the script had finished (just as a way to test to see if IE7 would render the styles for the DOM created elements) but that didn't work.
And it's not possible to create these dynamic elements via innerHTML
because of the requirements of the script and the dynamic nature of the elements (it's a date picker script).
So ultimately I need to try and work out how to fix this bug with IE7.
Any ideas?
Kind regards, Mark