I am creating some elements in javascript like so:
var parent = document.createElement('div');
parent.setAttribute('id', 'parent');
var child = document.createElement('div');
child.setAttribute('class', 'child');
parent.appendChild(child);
otherelement.appendChild(parent);
I have a stylesheet which has styles for #parent
and .child
. However, it appears the styles are being applied to the parent but not the child. Does ie6 only support styles on id's and not classes or am I doing something wrong?