Modify ↓
Ticket #4961 (closed bug: invalid)
$('<style/>').append('styles') throws error in IE
| Reported by: | james_padolsey | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.4 |
| Component: | manipulation | Version: | 1.3.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Try this:
$('<style type="text/css"/>').append('body{background:red;}')
Throws a runtime error in IE (6/7).
Instead of appending the text node the styles need to be added via --styleElement.styleSheet.cssText--
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

I don't think this is a bug to be fixed, but I'll leave it open until we can find some place to document it.