S
sammati
I'm inserting elements into the DOM, but don't want them to inherit
*any* css at all (I can't control the CSS). Does anyone know if this
is possible?
I tried: element.style = null; But this doesn't work. I get an
error that "style" is read-only.
Am I going to have to loop over every possible style property and set
it to some "default" value?
eg:
//yes, i know, it's not proper JS. I forgot how to iterate over
objects.
defaults = {color: 'black', background: 'transparent', ... lots of
work ... };
foreach (defaults as key=>value){
eval("element.style." + key) = value;
}
That would suck.
Any ideas?
Thanks.
-sam
*any* css at all (I can't control the CSS). Does anyone know if this
is possible?
I tried: element.style = null; But this doesn't work. I get an
error that "style" is read-only.
Am I going to have to loop over every possible style property and set
it to some "default" value?
eg:
//yes, i know, it's not proper JS. I forgot how to iterate over
objects.
defaults = {color: 'black', background: 'transparent', ... lots of
work ... };
foreach (defaults as key=>value){
eval("element.style." + key) = value;
}
That would suck.
Any ideas?
Thanks.
-sam