Hi Guys,
I have a function doing the following using javascript
:
- Create link element and set href=cssFile.
- Insert the link element in head tag.
- Create a div element.
- Set the class name using setAttribute
appendChild
the div on body.- Now getting CSS rule value using
document.defaultView.getComputedStyle(divElement, null)[cssRule]
.
Now getComputedStyle
is returning the default values, and if I wait on breakpoint using Firebug before getComputedStyle
call, then it returns the CSS rule from the CSS injected.
Regards,
Munim