<style> element in IE
<style> element in IE
Hi,
Is there a way to get the style element text ("body { background-color...") in internet explorer?
The following example works in FF but in IE it gives the following error:
Unexpected call to method or property.
- <html>
- <head>
- <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
- <script type="text/javascript">
- /*
- $(document).ready(function () {
- $('body').prepend('<div id="styleHolder"><style></style></div>');
- $('#styleHolder style').append('body { background-color: #FF00FF; }');
- alert($('#styleHolder style').html());
- });
- */
- $(document).ready(function () {
- $('body').prepend('<style id="styleHolder"></style>');
- $('#styleHolder').append('body { background-color: #FF00FF; }');
- alert($('#styleHolder').html());
- });
- </script>
- </head>
- <body>
- <div id="editable"></div>
- </body>
- </html>
Any help is much appreciated 